Prechádzať zdrojové kódy

收款认领相关功能

caipin 8 rokov pred
rodič
commit
c729295ae6

+ 55 - 0
global/js/invoice.js

@@ -87,4 +87,59 @@ $(function() {
 		});
 	});
 	
+	$("select[name='receivablesCategory']").click(function() {
+		var cid = $("select[name='receivablesCategory'] option:selected").attr("post-data");
+		var url = "/ajaxGetStaffByCategory";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				cid : cid
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					$("select[name='receivablesStaff']").html(data.html);
+				} 
+				//else
+				//	$("div[loading-msg='true']").html("illegal request");
+			},
+			error : function(err) {
+			}
+		});
+	});
+	
+	$('a[node-receivables="true"]').click(function() {
+		var postData =  $(this).attr("data-key");
+		var url = "/ajaxGetInvoiceReceivables";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				key : postData
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					$("input[name='key']").val(postData);
+					
+					$("td[node-receivablesSerial]").html(data.detail.receivablesSerial);
+					$("td[node-inputStaff]").html(data.detail.inputStaff+" "+data.detail.date);
+					$("td[node-price]").html("<b>"+data.detail.receivablesPrice+"</b>");
+					$("td[node-message]").html(data.detail.receivablesMessage);
+					$("td[node-bank]").html(data.detail.receivablesBank);
+					$("td[node-date]").html(data.detail.receivablesDate);
+				} 
+				//else
+				//	$("div[loading-msg='true']").html("illegal request");
+			},
+			error : function(err) {
+			}
+		});
+	});
+	
 })

+ 13 - 0
global/js/invoice.validator.js

@@ -105,4 +105,17 @@ $(function () {
 	    }
 	});
 	
+	$("form[name='receivablesInvoice']").validator({
+	    timely: 3,
+	    focusCleanup: true,
+	    fields: {
+	    	receivablesPrice: 'required; '
+		    ,receivablesMessage: 'required; '
+			,receivablesBank: 'required '
+			,receivablesDate: 'required '
+			,receivablesCategory: 'required '
+			,receivablesStaff: 'required '
+	    }
+	});
+	
 })

+ 27 - 0
global/js/receipt.js

@@ -75,6 +75,33 @@ function showOpinion(receiptOrder){
 
 $(function() {
 
+	$('a[node-ReceiptBack="true"]').click(function(){
+		var rid=$(this).attr("p-d");
+		var opinion=$('#opinion_'+rid).val();
+		
+		var url="/approvalChe";
+		$.ajax({
+			url:url,
+			type: "post",
+			cache: false,
+			dataType: "json",
+			data: {
+				rid:rid,
+				opinion:opinion
+			},
+			global: true,
+			success: function(data){
+				if(data.status==2){
+					alert('参数错误');
+				}else{
+					window.location.href="/approvalExpenses";
+				}
+			},
+			error:function(err){
+			}
+			});
+	});
+	
 	$("a[id^=examine]").click(function(){
 		var rid=$(this).attr('data');
 		var url="/ajaxExamine";

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

@@ -217,7 +217,7 @@ $route['*']['/approvalDetails/:rid'] = array('ReceiptController', 'approvalDetai
 $route['*']['/remittance'] = array('ReceiptController', 'remittance', 'authName' =>  'Hello', 'auth' => array('costsmart' => 'costsmart'));//
 $route['*']['/approval/:status'] = array('ReceiptController', 'approval');
 $route['*']['/updateApprovalReceipt'] = array('ReceiptController', 'updateApprovalReceipt');
-$route['*']['/approvalChe/:rid'] = array('ReceiptController', 'updateCheReceipt');
+$route['*']['/approvalChe'] = array('ReceiptController', 'updateCheReceipt');
 
 $route['*']['/revisePrice'] = array('ReceiptController', 'revisePrice');
 $route['*']['/personalCollect'] = array('ReceiptController', 'personalCollect');
@@ -369,9 +369,15 @@ $route['get']['/invoiceUntread'] = array('InvoiceController', 'invoiceUntread');
 $route['post']['/invoiceUntreadEstablishedDo'] = array('InvoiceController', 'invoiceUntreadEstablishedDo');
 
 $route['get']['/invoiceReceivables'] = array('InvoiceController', 'invoiceReceivables');
+$route['get']['/invoiceReceivablesClaim'] = array('InvoiceController', 'invoiceReceivablesClaim');
+$route['post']['/invoiceReceivablesDo'] = array('InvoiceController', 'invoiceReceivablesDo');
+$route['post']['/invoiceReceivablesAscription'] = array('InvoiceController', 'invoiceReceivablesAscription');
+
 
 
 $route['post']['/ajaxGetInvoicePostDetail'] = array('InvoiceController', 'ajaxGetInvoicePostDetail');
+$route['post']['/ajaxGetStaffByCategory'] = array('InvoiceController', 'ajaxGetStaffByCategory');
+$route['post']['/ajaxGetInvoiceReceivables'] = array('InvoiceController', 'ajaxGetInvoiceReceivables');
 
 //假期管理
 $route['*']['/myList'] = array('HolidayController', 'myList');

+ 147 - 17
protected/controller/InvoiceController.php

@@ -373,7 +373,7 @@ class InvoiceController extends DooController {
 	/**
 	 * 申请退票
 	 */
-	function invoiceUntreadDo(){
+	function invoiceUntreadDo() {
 		$untreadIidKey = $this->get_args ( 'untreadIidKey' ) ? $this->get_args ( 'untreadIidKey' ) : '';
 		$untreadReason = $this->get_args ( 'untreadReason' ) ? $this->get_args ( 'untreadReason' ) : "";
 		$untreadPost = $this->get_args ( 'untreadPost' ) ? $this->get_args ( 'untreadPost' ) : "";
@@ -395,13 +395,13 @@ class InvoiceController extends DooController {
 				'untreadStatus' => 1,
 				'untreadReason' => $untreadReason,
 				'untreadPost' => $untreadPost,
-				'updateTime' => date ( "Y-m-d H:i:s" )
+				'updateTime' => date ( "Y-m-d H:i:s" ) 
 		);
-		if($untreadPost==1){
+		if ($untreadPost == 1) {
 			$item += array (
 					'untreadCompany' => $untreadCompany,
 					'untreadNumber' => $untreadNumber,
-					'untreadItems' => $untreadItems
+					'untreadItems' => $untreadItems 
 			);
 		}
 		$invoice->setInvoiceByCondition ( $item );
@@ -413,7 +413,7 @@ class InvoiceController extends DooController {
 				'username' => $this->staff [0] ['username'],
 				'uid' => $this->staff [0] ['sid'],
 				'category' => $this->staff [0] ['category'],
-				'iid' => $iid
+				'iid' => $iid 
 		);
 		$invoiceOperationLog->setInvoiceOperationLog ( $item );
 		
@@ -608,7 +608,7 @@ class InvoiceController extends DooController {
 				} elseif ($status == 4) {
 					$invoice->status = $status;
 					$item = array (
-							'operation' => $opinion
+							'operation' => $opinion 
 					);
 				}
 			}
@@ -739,7 +739,6 @@ class InvoiceController extends DooController {
 			die ( 'illegal request' );
 		if (! empty ( $iid ) && ! empty ( $invoiceNo )) {
 			
-			
 			Doo::loadModel ( 'invoiceOperationLog' );
 			$invoiceOperationLog = new invoiceOperationLog ();
 			
@@ -821,12 +820,12 @@ class InvoiceController extends DooController {
 	/**
 	 * 退票处理页面
 	 */
-	function invoiceUntread(){
+	function invoiceUntread() {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
 		
-		$untreadInvoice=$invoice->getInvoiceByUntreadStatus(1);
-		$establishedInvoice=$invoice->getInvoiceByUntreadStatus(2);
+		$untreadInvoice = $invoice->getInvoiceByUntreadStatus ( 1 );
+		$establishedInvoice = $invoice->getInvoiceByUntreadStatus ( 2 );
 		
 		$data ['untreadInvoice'] = $untreadInvoice;
 		$data ['establishedInvoice'] = $establishedInvoice;
@@ -840,8 +839,7 @@ class InvoiceController extends DooController {
 	/**
 	 * 确认收到退回的发票,开票状态为退回
 	 */
-	function invoiceUntreadEstablishedDo(){
-		
+	function invoiceUntreadEstablishedDo() {
 		$untreadIidKey = $this->get_args ( 'untreadIidKey' ) ? $this->get_args ( 'untreadIidKey' ) : '';
 		
 		Doo::loadModel ( 'invoice' );
@@ -856,9 +854,9 @@ class InvoiceController extends DooController {
 		$item = array (
 				'iid' => $iid,
 				'untreadStatus' => 2,
-				'updateTime' => date ( "Y-m-d H:i:s" )
+				'updateTime' => date ( "Y-m-d H:i:s" ) 
 		);
-			
+		
 		$invoice->setInvoiceByCondition ( $item );
 		$item = array (
 				'date' => date ( "Y-m-d H:i:s" ),
@@ -868,14 +866,23 @@ class InvoiceController extends DooController {
 				'username' => $this->staff [0] ['username'],
 				'uid' => $this->staff [0] ['sid'],
 				'category' => $this->staff [0] ['category'],
-				'iid' => $iid
+				'iid' => $iid 
 		);
 		$invoiceOperationLog->setInvoiceOperationLog ( $item );
 		
 		return "/invoiceUntread";
 	}
-	
-	function invoiceReceivables(){
+	function invoiceReceivables() {
+		Doo::loadModel ( 'L_category' );
+		$lCategory = new L_category ();
+		Doo::loadModel('staff');
+		$staff=new staff();
+		
+		$category = $lCategory->getCategory ();
+		$staffList = $staff->getStaffByCid($this->staff[0]['cid']);
+		
+		$data ['staffList'] = $staffList;
+		$data ['category'] = $category;
 		
 		$data ['memu'] = "invoice";
 		$data ['staff'] = $this->staff;
@@ -883,6 +890,129 @@ class InvoiceController extends DooController {
 		$this->render ( "/admin/invoiceReceivables", $data );
 	}
 	
+	/**
+	 * 录入收款数据
+	 * @return string
+	 */
+	function invoiceReceivablesDo() {
+		
+		$receivablesPrice = $this->get_args ( 'receivablesPrice' ) ? $this->get_args ( 'receivablesPrice' ) : "";
+		$receivablesMessage = $this->get_args ( 'receivablesMessage' ) ? $this->get_args ( 'receivablesMessage' ) : "";
+		$receivablesBank = $this->get_args ( 'receivablesBank' ) ? $this->get_args ( 'receivablesBank' ) : "";
+		$receivablesDate = $this->get_args ( 'receivablesDate' ) ? $this->get_args ( 'receivablesDate' ) : "";
+		$receivablesCategory = $this->get_args ( 'receivablesCategory' ) ? $this->get_args ( 'receivablesCategory' ) : "";
+		$receivablesStaff = $this->get_args ( 'receivablesStaff' ) ? $this->get_args ( 'receivablesStaff' ) : "";
+		
+		Doo::loadModel ( 'invoiceReceivables' );
+		$invoiceReceivables = new invoiceReceivables ();
+		
+		if (! empty ( $receivablesPrice ) && ! empty ( $receivablesMessage ) && ! empty ( $receivablesBank ) && ! empty ( $receivablesDate ) && ! empty ( $receivablesCategory ) && ! empty ( $receivablesStaff )) {
+			
+			$item = array (
+					'receivablesPrice' =>$receivablesPrice,
+					'receivablesMessage' =>$receivablesMessage,
+					'receivablesSerial' =>"#SK" . date ( "Ymd" ) . mt_rand ( 1000, 9999 ),
+					'receivablesBank' =>$receivablesBank,
+					'receivablesDate' =>$receivablesDate,
+					'inputStaff' =>$this->staff[0]['username'],
+					
+					'receivablesCategory' =>$receivablesCategory,
+					'receivablesStaff' => $receivablesStaff
+			);
+			$irid = $invoiceReceivables->addInvoiceReceivables( $item );
+		}
+		
+		return "/invoiceReceivables";
+	}
+	/**
+	 * 收款认领页面-包括公共认领 办事处认领 最近已认领数据
+	 */
+	function invoiceReceivablesClaim(){
+		Doo::loadModel ( 'invoiceReceivables' );
+		$invoiceReceivables = new invoiceReceivables ();
+		
+		$receivablesList=$invoiceReceivables->getInvoiceReceivablesByClaim($this->staff[0]['cid']);
+		
+		$data ['receivablesList'] = $receivablesList;
+		
+		$data ['memu'] = "invoice";
+		$data ['staff'] = $this->staff;
+		$data ['receiptMemu'] = 'invoiceReceivablesClaim';
+		$this->render ( "/admin/invoiceReceivablesClaim", $data );
+	}
+	
+	/**
+	 * 管理员录入的收款 ,确认认领到谁的名下
+	 */
+	function invoiceReceivablesAscription(){
+		$irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
+		Doo::loadModel ( 'invoiceReceivables' );
+		$invoiceReceivables = new invoiceReceivables ();
+		
+		$detail=$invoiceReceivables->getInvoiceReceivablesByIrid($irid);
+		
+		if (!empty($detail)&&$detail['receivablesStaff']=='PUBLIC'){
+			$item = array (
+				'irid' =>$detail['irid'],
+				'receivablesCategory' =>$this->staff[0]['cid'].":".$this->staff[0]['category'],
+				'receivablesStaff' => $this->staff[0]['sid']."-".$this->staff[0]['username'],
+				'confirmTime' => date ( "Y-m-d H:i:s" )
+			);
+			$invoiceReceivables->setInvoiceReceivablesByCondition( $item );
+		}
+		
+		return "/invoiceReceivablesClaim";
+	}
+	
+	function ajaxGetInvoiceReceivables(){
+		$irid = $this->get_args ( 'key' ) ? $this->get_args ( 'key' ) : "";
+		Doo::loadModel ( 'invoiceReceivables' );
+		$invoiceReceivables = new invoiceReceivables ();
+		
+		$detail=$invoiceReceivables->getInvoiceReceivablesByIrid($irid);
+		
+		echo json_encode ( array (
+				'status' => 1,
+				'detail' => $detail
+		) );
+	}
+	
+	/**
+	 * 异步获取办事处用户
+	 */
+	function ajaxGetStaffByCategory() {
+		$cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : "";
+		Doo::loadModel('staff');
+		$staff=new staff();
+	
+		if ($cid=="PUBLIC"){
+			echo json_encode ( array (
+					'status' => 1,
+					'html' => '<option value="PUBLIC">办事处待认领款项</option>'
+			) );
+			die ();
+		}
+		
+		if (! is_numeric ( $cid )) {
+			echo json_encode ( array (
+					'status' => 0,
+					'msg' => 'illegal request'
+			) );
+			die ();
+		}
+	
+		$staffList = $staff->getStaffByCid($cid);
+		
+		$html='<option value="PUBLIC">办事处待认领款项</option>';
+		foreach ($staffList as $key=>$value){
+			$html.='<option value="'.$value['sid'].'-'.$value['username'].'">'.$value['category'].'-'.$value['username'].'</option>';
+		}
+		
+		echo json_encode ( array (
+				'status' => 1,
+				'html' => $html
+		) );
+	}
 	
 	/**
 	 * 异步获取一条发票的邮寄信息

+ 15 - 3
protected/controller/ReceiptController.php

@@ -6732,7 +6732,10 @@ $receiptList[$key]['verifyList']=$verifyList;
 	
 	function updateCheReceipt(){
 		
-		$rid=isset($this->params['rid'])&&is_numeric($this->params['rid'])?$this->params['rid']:0;
+		$rid=$this->get_args('rid')&&is_numeric($this->get_args('rid'))?$this->get_args('rid'):0;
+		$opinion=$this->get_args('opinion')?$this->get_args('opinion'):"";
+		
+		//$rid=isset($this->params['rid'])&&is_numeric($this->params['rid'])?$this->params['rid']:0;
 		
 		if (!empty($rid)){
 			//操作记录
@@ -6772,7 +6775,7 @@ $receiptList[$key]['verifyList']=$verifyList;
 			$receiptLog->username=$this->staff[0]['username'];
 			$receiptLog->uid=$this->staff[0]['sid'];
 			$receiptLog->date=date("Y-m-d");
-			$receiptLog->opinion='撤回';
+			$receiptLog->opinion=$opinion;
 			$receiptLog->img=$this->staff[0]['avatar'];
 			$receiptLog->status=4;
 			$receiptLog->rid=$rid;
@@ -6781,10 +6784,19 @@ $receiptList[$key]['verifyList']=$verifyList;
 			
 			$receipt->status=4;
 			$receipt->update(array('where'=>'rid='.$rid));
+			
+			
+			echo json_encode ( array (
+					'status' => 1
+			) );die;
+			
 		}
 		
+		echo json_encode ( array (
+				'status' => 2
+		) );die;
 		//echo "ddd";
-		return '/saeaBorad';
+		//return '/saeaBorad';
 	}
 	
 	function revisePrice(){

+ 179 - 0
protected/model/invoiceReceivables.php

@@ -0,0 +1,179 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+/**
+ * 发票审批相关信息及其操作业务逻辑
+ * @author CP.
+ * @version 1.0
+ * @namespace invoice
+ * @package invoiceModel
+ */
+class invoiceReceivables extends DooModel {
+	private $INVOICEKEY = "APPROVAL";
+	public $irid;
+	public $receivablesPrice;
+	public $receivablesSerial;
+	public $receivablesMessage;
+	public $receivablesBank;
+	public $receivablesDate;
+	public $receivablesCategory;
+	public $receivablesStaff;
+	public $inputStaff;
+	public $date;
+	public $confirmTime;
+	
+	public $_table = 'CLD_invoiceReceivables';
+	public $_primarykey = 'irid';
+	public $_fields = array (
+			'irid',
+			'receivablesPrice',
+			'receivablesSerial',
+			'receivablesMessage',
+			'receivablesBank',
+			'receivablesDate',
+			'receivablesCategory',
+			'receivablesStaff',
+			'inputStaff',
+			'date',
+			'confirmTime'
+	);
+
+	public function getInvoiceReceivablesByClaim($cid){
+		$list['csClaim'] = $this->find ( array (
+				'where' => "receivablesCategory='public' and receivablesStaff='public' ",
+				'desc' => 'irid',
+				'asArray' => TRUE
+		) );
+		foreach ( $list ['csClaim'] as $key => $value ) {
+			$list ['csClaim'] [$key] ['iidKey'] = $this->authcode ( $value ['irid'], '' );
+			//$list ['csClaim'] [$key] ['iidKeyUrl'] = $XDeode->encode ( $value ['iid'] );
+		}
+		
+		$list['sClaim'] = $this->find ( array (
+				'where' => "receivablesCategory!='public' and receivablesStaff='public' and receivablesCategory like '".$cid.":%'",
+				'desc' => 'irid',
+				'asArray' => TRUE
+		) );
+		foreach ( $list ['sClaim'] as $key => $value ) {
+			$list ['sClaim'] [$key] ['iidKey'] = $this->authcode ( $value ['irid'], '' );
+		}
+		
+		$list['arClaim'] = $this->find ( array (
+				'where' => "receivablesCategory!='public' and receivablesStaff!='public' and receivablesCategory like '".$cid.":%'",
+				'desc' => 'irid',
+				'asArray' => TRUE
+		) );
+		foreach ( $list ['arClaim'] as $key => $value ) {
+			$staff = explode ( "-", $value ['receivablesStaff'] );
+			$list ['arClaim'] [$key] ['sid'] = $staff [0];
+			$list ['arClaim'] [$key] ['username'] = $staff [1];
+		}
+		
+		return $list;
+	}
+	
+	public function getInvoiceReceivablesByIrid($irid=""){
+		$irid=$this->authcode ($irid );
+		$detail=array();
+		if (!empty($irid)&&is_numeric($irid))
+		$detail = $this->getOne ( array (
+				'where' => " irid=" . $irid,
+				'asArray' => TRUE
+		) );
+		return $detail;
+	}
+	
+	/**
+	 * 添加一个收款
+	 * @param array $item 收款相关数据
+	 * @return number 返回收款ID
+	 */
+	public function addInvoiceReceivables($item = array()) {
+		$lid = 0;
+		if (is_array ( $item ) && ! empty ( $item )) {
+			foreach ( $item as $key => $value ) {
+				$this->$key = $value;
+			}
+			$lid = $this->insert ();
+		}
+		return $lid;
+	}
+	
+	/**
+	 * 根据参数字段更新相应字段(主键ID必须传)
+	 * @param array $item 相关需要更新的字段信息
+	 * @return number 返回发票ID
+	 */
+	public function setInvoiceReceivablesByCondition($item = array()) {
+		$lid = 0;
+		if (is_array ( $item ) && ! empty ( $item )) {
+			foreach ( $item as $key => $value ) {
+				$this->$key = $value;
+			}
+			$lid = $this->update ();
+		}
+		return $lid;
+	}
+
+	/**
+	 * 加密或解密指定字符串
+	 *
+	 * @param string $string 要加密或解密的字符串
+	 * @param string $operation 当取值为'DECODE'时表示解密,否则为加密
+	 * @param string $key 加解密的key
+	 * @param $expiry 超时值
+	 *
+	 */
+	function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
+		$ckey_length = 4;
+		if (! $key) {
+			$key = $this->INVOICEKEY;
+		}
+		$key = md5 ( $key );
+		$keya = md5 ( substr ( $key, 0, 16 ) );
+		$keyb = md5 ( substr ( $key, 16, 16 ) );
+		$keyc = $ckey_length ? ($operation == 'DECODE' ? substr ( $string, 0, $ckey_length ) : substr ( md5 ( microtime () ), - $ckey_length )) : '';
+	
+		$cryptkey = $keya . md5 ( $keya . $keyc );
+		$key_length = strlen ( $cryptkey );
+	
+		$string = $operation == 'DECODE' ? base64_decode ( substr ( $string, $ckey_length ) ) : sprintf ( '%010d', $expiry ? $expiry + time () : 0 ) . substr ( md5 ( $string . $keyb ), 0, 16 ) . $string;
+		$string_length = strlen ( $string );
+	
+		$result = '';
+		$box = range ( 0, 255 );
+	
+		$rndkey = array ();
+		for($i = 0; $i <= 255; $i ++) {
+			$rndkey [$i] = ord ( $cryptkey [$i % $key_length] );
+		}
+	
+		for($j = $i = 0; $i < 256; $i ++) {
+			$j = ($j + $box [$i] + $rndkey [$i]) % 256;
+			$tmp = $box [$i];
+			$box [$i] = $box [$j];
+			$box [$j] = $tmp;
+		}
+	
+		for($a = $j = $i = 0; $i < $string_length; $i ++) {
+			$a = ($a + 1) % 256;
+			$j = ($j + $box [$a]) % 256;
+			$tmp = $box [$a];
+			$box [$a] = $box [$j];
+			$box [$j] = $tmp;
+			$result .= chr ( ord ( $string [$i] ) ^ ($box [($box [$a] + $box [$j]) % 256]) );
+		}
+	
+		if ($operation == 'DECODE') {
+			if ((substr ( $result, 0, 10 ) == 0 || substr ( $result, 0, 10 ) - time () > 0) && substr ( $result, 10, 16 ) == substr ( md5 ( substr ( $result, 26 ) . $keyb ), 0, 16 )) {
+				return substr ( $result, 26 );
+			} else {
+				return '';
+			}
+		} else {
+			return $keyc . str_replace ( '=', '', base64_encode ( $result ) );
+		}
+	}
+	
+}
+
+?>

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

@@ -5,7 +5,7 @@
 			>我的发票
 	</a></li>
 	<li class="news"><a href="invoice-billing-my.html">我的收款</a></li>
-	<li><a href="invoice-billing.html">收款认领</a></li>
+	<li><a <!-- if {{receiptMemu}}=="invoiceReceivablesClaim" --> class="selected" <!-- endif --> href="/invoiceReceivablesClaim">收款认领</a></li>
 
 
 

+ 30 - 111
protected/view/admin/invoiceReceivables.html

@@ -1,4 +1,9 @@
 <!-- include 'header' -->
+<link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/jquery.validator.css">
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/jquery.validator.min.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/zh-CN.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.validator.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">
@@ -65,106 +70,10 @@
 		</div>
 	</div>
 
-	<!--弹出变更-->
-<div class="modal hide fade" id="receive">
-	<div class="modal-dialog">
-		<div class="modal-content">
-    <div class="modal-header">
-    <h3>变更认领人</h3>
-    </div>
-    <div class="modal-body">
-    	<form class="form-horizontal">
-			<div class="control-group">
-				<label class="control-label"><span class="colRed">*</span>办事处</label>
-				<div class="controls">
-					<select><option>公共待认领收款</option><option>广西办</option></select>
-				</div>
-			</div>
-			<div class="control-group">
-				<label class="control-label"></label>
-				<div class="controls">
-					<select><option>办事处待认领收款</option><option>姜栋</option></select>
-				</div>
-			</div>
-		</form>
-    </div>
-	<div class="modal-footer">
-	    <a href="#" class="button">确定</a>
-	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
-	</div>
-			</div></div>
-</div>
-    <!--弹出变更-->
-	<!--弹出修改-->
-<div class="modal hide fade" id="billeidt">
-	<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" colspan="4">收款信息填写</th>
-					</tr>
-					<tr>
-						<th class="taC">收款金额</th><td><input value="0" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number"></td>
-					</tr>
-					<tr>
-						<th class="taC">收款信息</th><td><input type="text"></td>
-					</tr>
-					<tr>
-						<th class="taC">收款银行</th><td>
-						<select>
-							<option>广发银行珠海分行柠溪支行</option>
-						</select></td>
-					</tr>
-					<tr>
-						<th class="taC">银行到帐时间</th><td><input type="date"></td>
-					</tr>
-					<tr>
-						<th class="taC">认领收款</th><td colspan="3">
-						<select>
-							<option>公共待认领款项</option>
-							<option>广东办</option>
-							<option>广西办</option>
-							<option>重庆办</option>
-						</select>
-
-						<select>
-							<option>办事处待认领款项</option>
-							<option>广东办-刘飞</option>
-						</select></td>
-					</tr>
-					</tbody></table>
-			</div>
-	<div class="modal-footer">
-	    <a href="#" class="button">确定</a>
-	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
-	</div>
-			</div></div>
-</div>
-    <!--弹出修改-->   
-	<!--弹出删除-->
-<div class="modal hide fade" id="billdel">
-	<div class="modal-dialog">
-		<div class="modal-content">
-    <div class="modal-header">
-    <h3>删除收款</h3>
-    </div>
-    <div class="modal-body">
-    	数据诚可贵,删除需谨慎!
-    </div>
-	<div class="modal-footer">
-	    <a href="#" class="button">删除</a>
-	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
-	</div>
-			</div></div>
-</div>
-    <!--弹出删除-->
+	
 	<!--弹出(录入收款)-->
 	<div class="modal hide fade" id="inputbill">
+	<form action="/invoiceReceivablesDo" method="post" name="receivablesInvoice">
 		<div class="modal-dialog ">
 			<div class="modal-content">
 				<div class="modal-header">
@@ -177,41 +86,51 @@
 							<th class="taC" colspan="4">收款信息填写</th>
 						</tr>
 						<tr>
-							<th class="taC">收款金额</th><td><input value="0" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number"></td>
+							<th class="taC">收款金额</th>
+							<td>
+							<input value="" name="receivablesPrice" placeholder="输入开票金额" pattern="[0-9]" min="0" step="0.01" type="number">
+							</td>
 						</tr>
 						<tr>
-							<th class="taC">收款信息</th><td><input type="text"></td>
+							<th class="taC" >收款信息</th>
+							<td>
+							<input name="receivablesMessage" type="text">
+							</td>
 						</tr>
 						<tr>
 							<th class="taC">收款银行</th><td>
-							<select>
+							<select name="receivablesBank">
 								<option>广发银行珠海分行柠溪支行</option>
 							</select></td>
 						</tr>
 						<tr>
-							<th class="taC">银行到帐时间</th><td><input type="date"></td>
+							<th class="taC">银行到帐时间</th>
+							<td><input name="receivablesDate" type="date"></td>
 						</tr>
 						<tr>
 							<th class="taC">认领收款</th><td colspan="3">
-							<select>
-								<option>公共待认领款项</option>
-								<option>广东办</option>
-								<option>广西办</option>
-								<option>重庆办</option>
+							<select name="receivablesCategory" >
+								<option post-data="PUBLIC" value="PUBLIC" >公共待认领款项</option>
+								<!-- loop category -->
+								<option <!-- if {{category' value.cid}} == {{staff.0.cid}}  --> selected <!-- endif --> post-data="{{category' value.cid}}" value="{{category' value.cid}}:{{category' value.title}}" >{{category' value.title}}</option>
+								<!-- endloop -->
 							</select>
 
-							<select>
-								<option>办事处待认领款项</option>
-								<option>广东办-刘飞</option>
+							<select name="receivablesStaff">
+							<option value="PUBLIC">办事处待认领款项</option>
+								<!-- loop staffList -->
+								<option value="{{staffList' value.sid}}-{{staffList' value.username}}">{{staffList' value.category}}-{{staffList' value.username}}</option>
+								<!-- endloop -->
 							</select></td>
 						</tr>
 						</tbody></table>
 				</div>
 				<div class="modal-footer">
-					<a href="#" class="button" data-dismiss="modal" aria-hidden="true">确认录入</a>
+					<input type="submit" class="button" value="确认录入">
 					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
 				</div>
 			</div></div>
+			</form>
 	</div>
 	<!--弹出内容-->
 <script type="text/javascript">autoFlashHeight();</script>	

+ 133 - 0
protected/view/admin/invoiceReceivablesClaim.html

@@ -0,0 +1,133 @@
+<!-- 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">
+				<div class="borad-menu">
+				</div>
+				<div class="borad-news">
+					<div class="saeaList">
+						<div class="clearfix">
+							<!-- if !empty({{receivablesList.csClaim}}) -->
+							<legend><div class="fR"></div>公共·待认领款项</legend>
+							<table class="table table-bordered table-condensed">
+								<tbody>
+								<tr><th class="taC" width="70">收款金额</th><th class="taC">银行到帐信息</th><th class="taC">到帐银行/到帐时间</th><th class="taC">收款录入</th><th class="taC" width="120">操作</th></tr>
+								<!-- loop receivablesList.csClaim -->
+								<tr>
+									<td><b>¥{{csClaim' value.receivablesPrice}}</b></td>
+									<td>{{csClaim' value.receivablesMessage}}</td>
+									<td>{{csClaim' value.receivablesBank}} {{csClaim' value.receivablesDate}}</td>
+									<td>{{csClaim' value.inputStaff}} {{csClaim' value.date}}</td>
+									<td><a class="button btn-block" node-receivables="true" data-key="{{csClaim' value.iidKey}}" href="#receive" data-toggle="modal">认领收款</a></td>
+								</tr>
+								<!-- endloop -->
+								
+								</tbody>
+							</table>
+							<!-- else -->
+							<blockquote><p class="colGray">暂时没有需要处理的收款</p></blockquote>
+							<!-- endif -->
+						</div>
+						<div class="clearfix">
+							<!-- if !empty({{receivablesList.sClaim}}) -->
+							<legend><div class="fR"></div>办事处·待认领款项</legend>
+							<table class="table table-bordered table-condensed">
+								<tbody>
+								<tr><th class="taC" width="70">收款金额</th><th class="taC">银行到帐信息</th><th class="taC">到帐银行/到帐时间</th><th class="taC">收款录入</th><th class="taC" width="120">操作</th></tr>
+								<!-- loop receivablesList.sClaim -->
+								<tr>
+									<td><b>¥{{csClaim' value.receivablesPrice}}</b></td>
+									<td>{{csClaim' value.receivablesMessage}}</td>
+									<td>{{csClaim' value.receivablesBank}} {{csClaim' value.receivablesDate}}</td>
+									<td>{{csClaim' value.inputStaff}} {{csClaim' value.date}}</td>
+									<td><a class="button btn-block" node-receivables="true" data-key="{{csClaim' value.iidKey}}" href="#receive" data-toggle="modal">认领收款</a></td>
+								</tr>
+								<!-- endloop -->
+								</tbody>
+							</table>
+							<!-- else -->
+							<blockquote><p class="colGray">暂时没有需要处理的收款</p></blockquote>
+							<!-- endif -->
+						</div>
+						<div class="clearfix">
+						<!-- if !empty({{receivablesList.arClaim}}) -->
+							<legend>最近认领</legend>
+
+							<table class="table table-bordered table-condensed">
+								<tbody>
+								<tr><th class="taC" width="70">收款金额</th><th class="taC">银行到帐信息</th><th class="taC">银行/到帐时间</th><th class="taC">收款录入</th><th class="taC">收款认领</th></tr>
+								<!-- loop receivablesList.arClaim -->
+								<tr>
+									<td><b>¥{{csClaim' value.receivablesPrice}}</b></td>
+									<td>{{csClaim' value.receivablesMessage}}</td>
+									<td>{{csClaim' value.receivablesBank}} {{csClaim' value.receivablesDate}}</td>
+									<td>{{csClaim' value.inputStaff}} {{csClaim' value.date}}</td>
+									<td>{{csClaim' value.username}} {{csClaim' value.confirmTime}}</td>
+								</tr>
+								<!-- endloop -->
+								
+								</tbody>
+							</table>
+							<!-- else -->
+							<blockquote><p class="colGray">暂时没有已认领的收款</p></blockquote>
+							<!-- endif -->
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+
+	<!--弹出(录入收款)-->
+<div class="modal hide fade" id="receive">
+<form action="/invoiceReceivablesAscription" method="post" >
+	<input type="hidden" name="key" value="">
+	<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" colspan="4">收款详情</th></tr>
+					<tr>
+						<th class="taC">收款流水号</th><td node-receivablesSerial </td>
+						<th class="taC">录入收款</th><td node-inputStaff ></td>
+					</tr>
+					<tr>
+						<th class="taC">收款金额</th><td node-price ></td>
+						<th class="taC">收款信息</th><td node-message ></td>
+					</tr>
+					<tr>
+						<th class="taC">收款银行</th><td node-bank ></td>
+						<th class="taC">银行到帐</th><td node-date ></td>
+					</tr>
+					</tbody></table>
+			</div>
+	<div class="modal-footer">
+	<input type="submit" class="button"  value="确认认领">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	</div>
+			</div></div>
+			</form>
+</div>
+    <!--弹出内容-->        	
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>

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

@@ -278,7 +278,7 @@
 		  					
 		  						<!-- if {{receiptDetail' value.button}}==4 -->
 		  						
-		  						<a href="/approvalChe/{{receiptList' value.rid}}" class="buttonBack <!-- if {{receiptList' value.Rtype}}==1 --> buttonBlock  <!-- endif -->" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
+		  						<a href="javascript:void(0)" p-d="{{receiptList' value.rid}}" node-ReceiptBack="true" class="buttonBack <!-- if {{receiptList' value.Rtype}}==1 --> buttonBlock  <!-- endif -->" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
 	  							<!-- if {{receiptList' value.Rtype}}!=1 -->
 	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
 	  							<!-- endif -->

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

@@ -163,7 +163,7 @@
 		  					
 		  					<div class="reportButton clearfix">
 		  						<!-- if {{receiptDetail' value.button}}==4 -->
-		  						<a href="/approvalChe/{{receiptList' value.rid}}" class="buttonBack" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
+		  						<a href="javascript:void(0)" p-d="{{receiptList' value.rid}}" node-ReceiptBack="true"  class="buttonBack" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
 	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
 	  						
 		  						<!-- endif -->

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

@@ -216,7 +216,7 @@
 		  					
 		  						<!-- if {{receiptDetail' value.button}}==4 -->
 		  						
-		  						<a href="/approvalChe/{{receiptList' value.rid}}" class="buttonBack" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
+		  						<a href="javascript:void(0)" p-d="{{receiptList' value.rid}}" node-ReceiptBack="true" class="buttonBack" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>
 	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止报销单">终止</a>
 	  							<a href="javascript:void(0)" onClick="updateApprovalReceipt(1,{{receiptList' value.rid}})" class="buttonDone buttonBlock">同意支付</a>