caipin 7 anos atrás
pai
commit
f12ff7c4c4

+ 1 - 1
global/js/SWFUpload/mmSWFUpload.js

@@ -18,7 +18,7 @@ mmSWFUpload = {
 		} catch(e) {}
 		
 		// Create SWFObject
-		var so = new SWFObject("global/js/SWFUpload/upload.swf", "_mmSWFUploadField", this.addSetting("width", "76px"), this.addSetting("height", "21px"), this.addSetting("flash_version", "8"), "#000000");
+		var so = new SWFObject("/global/js/SWFUpload/upload.swf", "_mmSWFUploadField", this.addSetting("width", "76px"), this.addSetting("height", "21px"), this.addSetting("flash_version", "8"), "#000000");
 			
 		if(deconcept.SWFObjectUtil.getPlayerVersion(so.getAttribute("version")).major >= 8) {
 		

+ 13 - 5
global/js/example.js

@@ -1,6 +1,4 @@
-function $(id) {
-	return document.getElementById(id);
-}
+
 
 // Default upload start function.
 uploadStart = function(fileObj) {
@@ -27,8 +25,6 @@ uploadStart = function(fileObj) {
 uploadProgress = function(fileObj, bytesLoaded) {
 	var progress = $("progress");
 	var percent = Math.ceil((bytesLoaded / fileObj.size) * 100);
-	console.log(fileObj);
-	
 	
 	if(fileObj.type==".xlsx"){
 		var k=100-percent;
@@ -38,6 +34,18 @@ uploadProgress = function(fileObj, bytesLoaded) {
 	//progress.style.background = "#999";
 }
 
+invoiceStore=function(fileObj,serverData){
+	//console.log(serverData);
+	if(fileObj.type==".xlsx"){
+		document.getElementById('path').value=fileObj.name;
+		
+		$(fileObj.name).className = "uploadDone";
+		$(fileObj.name).innerHTML += " " + (Math.ceil(fileObj.size / 1000)) + " kb";
+	}else{
+		$(fileObj.name).innerHTML="请上传符合文件";
+	}
+}
+
 uploadComplete = function(fileObj) {
 	if(fileObj.type==".xlsx"){
 		document.getElementById('path').value=fileObj.name;

+ 156 - 1
global/js/invoice.js

@@ -1,4 +1,6 @@
 
+
+
 var notify = null;
 var isNotifyShowing = false;
 var isError = false;
@@ -67,8 +69,27 @@ else
     return false;
 }
 
+
+
+
+
+
+
+
+
+
 $(function() {
 	
+	
+	$('select[node-itSChange]').change(function() {
+		 var itsStatus=$(this).val();
+		
+		 var action = $('#its').attr("action");
+		 action=encodeURI(action+'?trainStatus='+itsStatus);
+		 $('#its').attr("action",action);
+		 $('#its').submit();
+	});
+	
 	$('select[node-iryChange]').change(function() {
 		 var year=$(this).val();
 		 var month="All";
@@ -266,6 +287,8 @@ $(function() {
 			global : true,
 			success : function(data) {
 				if (data.status == 1) {
+					
+					
 					$("td[recipients-data='express-msg']").html(data.invoiceDetail.recipients);
 					$("td[recipientsPhone-data='express-msg']").html(data.invoiceDetail.recipientsPhone);
 					$("td[recipientsAddress-data='express-msg']").html(data.invoiceDetail.recipientsAddress);
@@ -282,6 +305,45 @@ $(function() {
 		});
 	});
 	
+	$("a[node-post='expressActual-msg']").click(function() {
+		var postData = $(this).attr("post-data");
+		
+		$("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) {
+					
+					$("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
+					$("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
+					
+					$("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany+"&nbsp;<a target='_blank' href='http://www.kuaidi100.com/chaxun?com="+data.invoiceDetail.expressCom+"&nu="+data.invoiceDetail.expressNumber+"'>点击查询快递信息</a>");
+					$("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
+					
+//					$("td[recipients-data='express-msg']").html(data.invoiceDetail.recipients);
+//					$("td[recipientsPhone-data='express-msg']").html(data.invoiceDetail.recipientsPhone);
+//					$("td[recipientsAddress-data='express-msg']").html(data.invoiceDetail.recipientsAddress);
+//					$("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
+//					$("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
+//					$("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany);
+//					$("td[expressNumber-data='express-msg']").html(data.invoiceDetail.expressNumber+"&nbsp;<a target='_blank' href='http://www.kuaidi100.com/chaxun?com="+data.invoiceDetail.expressCom+"&nu="+data.invoiceDetail.expressNumber+"'>点击查询快递信息</a>");
+					$("div[loading-msg='express-msg']").html("");
+				} else
+					$("div[loading-msg='express-msg']").html("illegal request");
+			},
+			error : function(err) {
+			}
+		});
+	});
+	
 	$("select[name='receivablesCategory']").click(function() {
 		var cid = $("select[name='receivablesCategory'] option:selected").attr("post-data");
 		var url = "/ajaxGetStaffByCategory";
@@ -665,4 +727,97 @@ $(function() {
 	});
 	
 	
-})
+//	$("a[node-iStore=del]").click(function() {
+//		var iStoreKey = $(this).attr("data-key");
+//		$("input[id=iStoreKey]").val(iStoreKey);
+//	});
+		
+	
+	
+	
+	$("a[node-store=batchDel]").click(function() {
+		
+		var id_array=new Array();  
+		$('input[name="isBox"]:checked').each(function(){  
+		    id_array.push($(this).val());//向数组中添加元素  
+		});  
+		var idstr=id_array.join(',');//将数组元素连接起来以构建一个字符串  
+		$("input[id=batchStoreKey]").val(idstr);
+		
+	});
+	
+	$("a[node-store=batchMail]").click(function() {
+		
+		var id_array=new Array();  
+		$('input[name="isBox"]:checked').each(function(){  
+		    id_array.push($(this).val());
+		});  
+		var idstr=id_array.join(',');
+		$("input[id=BatchMailStoreKey]").val(idstr);
+		
+	});
+	$("a[node-store=batchApproval]").click(function() {
+		
+		var id_array=new Array();  
+		$('input[name="isBox"]:checked').each(function(){  
+		    id_array.push($(this).val());
+		});  
+		var idstr=id_array.join(',');
+		$("input[id=appBatchStoreKey]").val(idstr);
+		
+	});
+	
+	
+		
+	$("a[node-training=del]").click(function() {
+		var trainingKey = $(this).attr("data-key");
+		$("input[id='trainingKey']").val(trainingKey);
+	});
+})
+
+function invoiceStoreMail(Key){
+	
+	
+	$("input[id=MailStoreKey]").val(Key);
+	
+//	var url="/ajaxGetMailItemByIstore";
+//	$.ajax({
+//		url:url,
+//		type:"post",
+//		cache:false,
+//		dataType:"json",
+//		data:{
+//			storeKey:iStroreKey
+//		},
+//		global:true,
+//		success:function(data){
+//			
+//			console.log(data);
+//			
+//			if(data!='null'){
+//				
+//			}
+//			
+//			if(data.status!=1){
+//				$("#"+data.msgType+"Msg").addClass("colRed");
+//				$("#"+data.msgType+"Msg").html("设置失败").show(300).delay(3000).hide(300);
+//			}else{
+//				$("#"+data.msgType+"Msg").addClass("colGreen");
+//				$("#"+data.msgType+"Msg").html("设置成功").show(300).delay(3000).hide(300); 
+//			}
+//		},
+//		error:function(err){
+//			
+//		}
+//	});
+	
+}
+
+function invoiceStoreDel(iStoreKey){
+	//var iStoreKey = $(this).attr("data-key");
+	$("input[id=iStoreKey]").val(iStoreKey);
+}
+
+function invoiceStoreApproval(iStoreKey){
+	$("input[id=appStoreKey]").val(iStoreKey);
+}

+ 9 - 2
global/js/swfuplad2/handlers.js

@@ -101,14 +101,15 @@ function uploadProgress(file, bytesLoaded, bytesTotal) {
 		var percent = Math.ceil((bytesLoaded / bytesTotal) * 100);
 
 		var progress = new FileProgress(file, this.customSettings.progressTarget);
-		progress.setProgress(percent);
-		progress.setStatus("正在上传...");
+		//progress.setProgress(percent);
+		//progress.setStatus("正在上传...");
 	} catch (ex) {
 		this.debug(ex);
 	}
 }
 
 function uploadSuccess(file, serverData) {
+	
 	try {
 		var progress = new FileProgress(file, this.customSettings.progressTarget);
 		progress.setComplete();
@@ -174,6 +175,12 @@ function uploadError(file, errorCode, message) {
 
 function uploadComplete(file) {
 	if (this.getStats().files_queued === 0) {
+		
+		var progress = new FileProgress(file, this.customSettings.progressTarget);
+		progress.setComplete();
+		progress.setStatus("上传成功");
+		progress.toggleCancel(false);
+		
 		document.getElementById(this.customSettings.cancelButtonId).disabled = true;
 	}
 }

+ 5 - 0
global/js/swfuplad2/swfupload.js

@@ -980,3 +980,8 @@ SWFUpload.Console.writeLine = function (message) {
 };
 
 
+
+
+
+
+

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

@@ -43,7 +43,18 @@ $acl ['ordinary'] ['allow'] = array (
 				
 				'invoiceTraining',
 				'invoiceTrainingAdd',
-				
+				'invoiceTrainingDetail',
+				'invoiceTrainingUpload',
+				'invoiceStoreImport',
+				'invoiceStoreEdit',
+				'invoiceStoreEditDo',
+				'invoiceStoreDelete',
+				'invoiceStoreApproval',
+				'invoiceStoreMailItemSet',
+				'invoiceStoreBatchDelete',
+				'invoiceStoreBatchMailItemSet',
+				'invoiceStoreBatchApproval',
+				'ajaxGetMailItemByIstore',
 				'testSend'
 		) 
 );

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

@@ -390,6 +390,22 @@ $route['get']['/invoiceReceivablesAchieve/:page/:date/:MebSea'] = array('Invoice
 
 $route['*']['/invoiceTraining'] = array('InvoiceController', 'invoiceTraining');
 $route['post']['/invoiceTrainingAdd'] = array('InvoiceController', 'invoiceTrainingAdd');
+$route['*']['/invoiceTrainingDetail/:trainingKey'] = array('InvoiceController', 'invoiceTrainingDetail','extension'=>'.html');
+$route['*']['/invoiceTrainingUpload'] = array('InvoiceController', 'invoiceTrainingUpload');
+$route['*']['/invoiceStoreImport'] = array('InvoiceController', 'invoiceStoreImport');
+$route['*']['/invoiceStoreEdit/:storeKey'] = array('InvoiceController', 'invoiceStoreEdit','extension'=>'.html');
+$route['post']['/invoiceStoreEditDo'] = array('InvoiceController', 'invoiceStoreEditDo');
+$route['post']['/invoiceStoreDelete'] = array('InvoiceController', 'invoiceStoreDelete');
+$route['post']['/invoiceStoreApproval'] = array('InvoiceController', 'invoiceStoreApproval');
+
+$route['post']['/invoiceStoreMailItemSet'] = array('InvoiceController', 'invoiceStoreMailItemSet');
+$route['post']['/invoiceStoreBatchDelete'] = array('InvoiceController', 'invoiceStoreBatchDelete');
+$route['post']['/invoiceStoreBatchMailItemSet'] = array('InvoiceController', 'invoiceStoreBatchMailItemSet');
+$route['post']['/invoiceStoreBatchApproval'] = array('InvoiceController', 'invoiceStoreBatchApproval');
+
+
+$route['post']['/ajaxGetMailItemByIstore'] = array('InvoiceController', 'ajaxGetMailItemByIstore');
+
 
 
 $route['post']['/ajaxGetInvoiceInfoByType'] = array('InvoiceController', 'ajaxGetInvoiceInfoByType');

Diferenças do arquivo suprimidas por serem muito extensas
+ 1169 - 148
protected/controller/InvoiceController.php


+ 112 - 12
protected/controller/MainController.php

@@ -216,8 +216,55 @@ class MainController extends DooController {
 			$result = $query->fetchAll ();
 			$categorylist2 = $result;
 		}
+		
+		
+		
+		
+		
+		//有待优化
+		Doo::loadModel ( 'department' );
+		$department = new department ();
+		$categorylist3=$categorylist2;$bakCategory=array();
+		foreach ($categorylist3 as $key=>$value){
+			$departList=$department->getDepartmentBycid($value['cid']);
+			if (!empty($departList)){
+				//$bakCategory=$categorylist2[$key];
+		
+				array_unshift($bakCategory,$value);
+		
+				unset($categorylist2[$key]);
+				foreach ($departList as $v){
+					array_unshift($bakCategory,array(
+							'cid'=>$v['cid'],
+							'title'=>$value['title'],
+							'count'=>$value['count'],
+							'did'=>$v['did'],
+							'departmentName'=>$v['departmentName'],
+					));
+				}
+			}
+		}
+		
+		foreach ($bakCategory as $value){
+			array_unshift($categorylist2,$value);
+		}
+		
+		
+			
+		
+		$data ['did'] = '';
 		if (! empty ( $cid )) {
+			
 			$staffCondition = " and cid=" . $cid;
+			if (!is_numeric($cid)){
+				$cdid=explode('-', $cid);
+				$cid=$cdid[0];
+				$data ['did'] = $cdid[1];
+				$staffCondition = " and cid=" . $cid." and departmentID=".$cdid[1];
+			}
+			
+			
+			
 			if (! empty ( $sid ))
 				$condition = " and cid=" . $cid . " and sid=" . $sid;
 			else
@@ -781,8 +828,54 @@ class MainController extends DooController {
 			$result = $query->fetchAll ();
 			$categorylist2 = $result;
 		}
-		if (! empty ( $cid ))
-			$staffCondition = " and cid=" . $cid;
+		
+		
+		
+		//有待优化
+		Doo::loadModel ( 'department' );
+		$department = new department ();
+		$categorylist3=$categorylist2;$bakCategory=array();
+		foreach ($categorylist3 as $key=>$value){
+			$departList=$department->getDepartmentBycid($value['cid']);
+			if (!empty($departList)){
+				//$bakCategory=$categorylist2[$key];
+		
+				array_unshift($bakCategory,$value);
+		
+				unset($categorylist2[$key]);
+				foreach ($departList as $v){
+					array_unshift($bakCategory,array(
+							'cid'=>$v['cid'],
+							'title'=>$value['title'],
+							'count'=>$value['count'],
+							'did'=>$v['did'],
+							'departmentName'=>$v['departmentName'],
+					));
+				}
+			}
+		}
+		foreach ($bakCategory as $value){
+			array_unshift($categorylist2,$value);
+		}
+		
+		
+		
+		
+		
+		
+		
+		$data ['did'] = '';
+		if (! empty ( $cid )){
+			if(is_numeric($cid))
+				$staffCondition = " and cid=" . $cid;
+			else {
+				$cdid=explode('-', $cid);
+				$cid=$cdid[0];
+				$data ['did'] = $cdid[1];
+				$staffCondition = " and cid=" . $cdid[0]." and departmentID=".$cdid[1];
+			}
+			//$staffCondition = " and cid=" . $cid;
+		}
 		
 		$staffList = $staff->find ( array (
 				'where' => ' username!="admin"' . $staffCondition,
@@ -4477,7 +4570,7 @@ class MainController extends DooController {
 			
 			$client->update ();
 		}
-		return "/";
+		return "/contacts";
 	}
 	function AddClientInfo() { // 不编辑公司
 		$cid = $this->get_args('cid') ? $this->get_args('cid') : 0;  
@@ -6362,8 +6455,13 @@ class MainController extends DooController {
 			
 			$chunkMail = array_chunk ( $toMail, 80 );
 			$chunkSubMail = array_chunk ( $subMail, 80 );
+			
+			//print_r($chunkMail);
+			//echo "<br/>";
+			//die;
 			$vii = 0;
 			foreach ( $chunkMail as $key => $value ) {
+				print_r($value);echo "<br/>";
 				$l = $s = $c = $i = $cate = $con = $annex = array ();
 				$toFormatMail ['to'] = $value;
 				$cn = $chunkSubMail [$key];
@@ -6399,15 +6497,17 @@ class MainController extends DooController {
 				
 				$post_data = http_build_query ( $param );
 				
-				$ch = curl_init ();
-				curl_setopt ( $ch, CURLOPT_POST, 1 );
-				curl_setopt ( $ch, CURLOPT_URL, $url );
-				curl_setopt ( $ch, CURLOPT_HEADER, false ); // 设定是否输出页面内容
-				curl_setopt ( $ch, CURLOPT_NOBODY, false );
-				curl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );
+// 				$ch = curl_init ();
+// 				curl_setopt ( $ch, CURLOPT_POST, 1 );
+// 				curl_setopt ( $ch, CURLOPT_URL, $url );
+// 				curl_setopt ( $ch, CURLOPT_HEADER, false ); // 设定是否输出页面内容
+// 				curl_setopt ( $ch, CURLOPT_NOBODY, false );
+// 				curl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );
 				
-				$result = curl_exec ( $ch );
-				curl_close ( $ch );
+				file_put_contents(DOO::conf ()->SITE_PATH . "upload/invoiceTraining/email.json", json_encode ( $toFormatMail ).PHP_EOL,FILE_APPEND);
+				
+				//$result = curl_exec ( $ch );
+				//curl_close ( $ch );
 				
 				/*
 				 * if($result=='success'){ $eM=new eMailList(); $eM->status='2'; $eM->update(array('where'=>'elid=?','param'=>array($elid))); }
@@ -6418,7 +6518,7 @@ class MainController extends DooController {
 				$send = 1;
 			
 			$sql = "update `CLD_eMailList` set  send" . $send . "='1' where elid = '" . $elid . "'";
-			Doo::db ()->query ( $sql );
+			//Doo::db ()->query ( $sql );
 			
 			$isSend = $eMList->getOne ( array (
 					'where' => 'elid =' . $elid . ' and status=0 and send1=1 and send2=1 and send3=1',

+ 32 - 22
protected/controller/ReceiptController.php

@@ -2477,7 +2477,7 @@ class ReceiptController extends DooController {
 	}
 	function approvalExpenses() {
 		$status = isset ( $this->params ['status'] ) ? $this->params ['status'] : 0;
-		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : date ( 'Y' );
+		$year = $this->get_args ( 'year' ) ? $this->get_args ( 'year' ) : '';
 		$month = $this->get_args ( 'month' ) ? $this->get_args ( 'month' ) : "";
 		$cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : 0;
 		$sid = $this->get_args ( 'sid' ) ? $this->get_args ( 'sid' ) : 0;
@@ -2519,10 +2519,19 @@ class ReceiptController extends DooController {
 			// if ($status==0)
 			// $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 )) $dateCondition = " and Year(pastDate) =" . $year . " and Month(pastDate) = " . $month; }
-		 */
+		
+		$dateCondition = " ";
+		
+// 		if (! empty ( $month ))
+// 			$dateCondition = " and Year(date) =" . $year . " and Month(date) = " . $month;
+		if ($status == 'done'|| $status == 'termination') {
+			if (!empty($year)){
+			$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 . "' ";
@@ -2593,30 +2602,31 @@ class ReceiptController extends DooController {
 		// ) );
 		// //echo 'status!=5 '.$dateCondition.$cateCondition.$staffCondition.' and verify in ('.$vid.')';
 		// } else
-		if ($status == 'done' || $status == 'termination') {//$dateCondition .
-			$pageinfo = $this->get_page ( "CLD_receipt",  $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ') and status!=5', $page, $page_size, "approvalExpenses/" . $status, $get, "" );
+		if ($status == 'done' || $status == 'termination') { // $dateCondition .
+			$pageinfo = $this->get_page ( "CLD_receipt", $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ') and status!=5', $page, $page_size, "approvalExpenses/" . $status, $get, "" );
 			
-			$receiptList = $receipt->find ( array (//$dateCondition.
-					'where' => 'status!=5  ' .   $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')',
+			$receiptList = $receipt->find ( array ( // $dateCondition.
+					'where' => 'status!=5  ' . $cateCondition . $staffCondition . $approvalCondition . $dateCondition . ' and verify in (' . $vid . ')',
 					'limit' => $pageinfo ['lower'] . ',' . $page_size,
 					'desc' => 'rid',
 					'asArray' => true 
 			) );
-		} else
-			$receiptList = $receipt->find ( array (//$dateCondition
-					'where' => 'status!=5 ' .  $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')',
+		} else {
+			$receiptList = $receipt->find ( array ( // $dateCondition
+					'where' => 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')',
 					'desc' => 'rid',
 					'asArray' => true 
 			) );
-		
+			// echo 'status!=5 ' . $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')';
+		}
 		$rLRes = $receipt->find ( array (
-				'where' => 'status=2 and (nowStaff like "%,' . $this->staff [0] ['sid'] . '%" or nowStaff like "%' . $this->staff [0] ['sid'] . ',%" or nowStaff=' . $this->staff [0] ['sid'] . ' )' . $cateCondition . $staffCondition,
+				'where' => 'status=2 and (nowStaff like "%,' . $this->staff [0] ['sid'] . '%" or nowStaff like "%' . $this->staff [0] ['sid'] . ',%" or nowStaff=' . $this->staff [0] ['sid'] . ' )' . $cateCondition . $staffCondition . ' and verify in (' . $vid . ')',
 				'desc' => 'rid',
 				'asArray' => true 
 		) );
 		
-		//echo 'status!=5 ' . $dateCondition . $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')';
-		//print_r($receiptList);
+		// echo 'status!=5 ' . $dateCondition . $cateCondition . $staffCondition . $approvalCondition . ' and verify in (' . $vid . ')';
+		// print_r($receiptList);
 		
 		$Locate = 0;
 		
@@ -3953,7 +3963,7 @@ class ReceiptController extends DooController {
 				$vid = 0;
 			
 			$approvalCondition = ' and status=2 and (nowStaff like "%,' . $this->staff [0] ['sid'] . '%" or nowStaff like "%' . $this->staff [0] ['sid'] . ',%" or nowStaff=' . $this->staff [0] ['sid'] . ' )';
-			$receipt=new receipt();
+			$receipt = new receipt ();
 			$rd = $receipt->getOne ( array (
 					'where' => 'status!=5 ' . $approvalCondition . ' and verify in(' . $vid . ')',
 					'asc' => 'rid',
@@ -5058,10 +5068,10 @@ class ReceiptController extends DooController {
 		$statusCon = '(status=8 or status=9 or status=1 or status=6 )';
 		$sopString = "";
 		
-		$lastYear=date("Y", strtotime("-1 year"));
+		$lastYear = date ( "Y", strtotime ( "-1 year" ) );
 		
 		if (empty ( $rdate ))
-			$dateCondition = " and (Year(date) =" . $year." or Year(date) = ".$lastYear.") ";
+			$dateCondition = " and (Year(date) =" . $year . " or Year(date) = " . $lastYear . ") ";
 		else
 			$dateCondition = " and date_format(date,'%Y-%m-%d')='" . $rdate . "' ";
 		
@@ -8254,7 +8264,7 @@ class ReceiptController extends DooController {
 				$vid = 0;
 			
 			$approvalCondition = ' and status=2 and (nowStaff like "%,' . $this->staff [0] ['sid'] . '%" or nowStaff like "%' . $this->staff [0] ['sid'] . ',%" or nowStaff=' . $this->staff [0] ['sid'] . ' )';
-			$receipt=new receipt();
+			$receipt = new receipt ();
 			$rd = $receipt->getOne ( array (
 					'where' => 'status!=5 ' . $approvalCondition . ' and verify in(' . $vid . ')',
 					'asc' => 'rid',
@@ -8275,7 +8285,7 @@ class ReceiptController extends DooController {
 			} else {
 				return '/receiptburEdi/' . $rd ['rid'];
 			}
-			//return "/approvalExpenses/pendApproval";
+			// return "/approvalExpenses/pendApproval";
 		}
 	}
 	function expensesRetreats() {
@@ -9107,7 +9117,7 @@ class ReceiptController extends DooController {
 					}
 					$m13 += $asum;
 					$html .= '<td class="taR colGreen"><b>¥' . $asum . '</b></td>';
-					$collectHtml [$value ['username']] = array (
+					$collectHtml [$value ['username'].'_'.$value['sid']] = array (
 							'html' => $html,
 							'sid' => $value ['sid'] 
 					);

+ 108 - 16
protected/model/invoice.php

@@ -17,6 +17,8 @@ class invoice extends DooModel {
 	 * @var integer $iid 发票ID
 	 */
 	public $iid;
+	public $isid;
+	public $trainId;
 	public $lossIid;
 	public $ipSource;
 	/**
@@ -194,6 +196,8 @@ class invoice extends DooModel {
 	public $_primarykey = 'iid';
 	public $_fields = array (
 			'iid',
+			'isid',
+			'trainId',
 			'ipSource',
 			'lossIid',
 			'invoiceManage',
@@ -270,7 +274,7 @@ class invoice extends DooModel {
 		if (is_numeric ( $iid ) && ! empty ( $iid ))
 			$Detail = $this->getOne ( $condition );
 		
-		if (empty($Detail))	
+		if (empty ( $Detail ))
 			return $Detail;
 		if (isset ( $Detail ['expressCompany'] ) && ! empty ( $Detail ['expressCompany'] )) {
 			$express = explode ( ":", $Detail ['expressCompany'] );
@@ -318,7 +322,7 @@ class invoice extends DooModel {
 	 * @param string $title 查询条件
 	 * @param string $query 默认模糊查询
 	 */
-	public function getInvoiceByTitle($title = "", $query = "FUZZY", $cond = '') {
+	public function getInvoiceByTitle($title = "", $query = "FUZZY", $cond = '', $fkq = false) {
 		$detail = array ();
 		if (! empty ( $title )) {
 			$condition = array (
@@ -333,13 +337,23 @@ class invoice extends DooModel {
 				$condition += array (
 						'where' => "(invoiceTitle = '" . $title . "' or invoiceCompany= '" . $title . "') " . $cond 
 				);
-			
-			$detail = $this->getOne ( $condition );
-			if (! empty ( $detail )) {
-				Doo::loadClass ( 'XDeode' );
-				$XDeode = new XDeode ( 5 );
-				$detail ['iidKey'] = $this->authcode ( $detail ['iid'], '' );
-				$detail ['iidKeyXD'] = $XDeode->encode ( $detail ['iid'] );
+			Doo::loadClass ( 'XDeode' );
+			$XDeode = new XDeode ( 5 );
+			if ($fkq) {
+				
+				$detail = $this->find ( $condition );
+				
+				foreach ( $detail as $key => $value ) {
+					$detail [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
+					$detail [$key] ['iidKeyXD'] = $XDeode->encode ( $value ['iid'] );
+				}
+			} else {
+				$detail = $this->getOne ( $condition );
+				if (! empty ( $detail )) {
+					
+					$detail ['iidKey'] = $this->authcode ( $detail ['iid'], '' );
+					$detail ['iidKeyXD'] = $XDeode->encode ( $detail ['iid'] );
+				}
 			}
 		}
 		
@@ -364,6 +378,52 @@ class invoice extends DooModel {
 	}
 	
 	/**
+	 * 统计培训班开票
+	 */
+	function sumOfinvoiceTrain($itidSql) {
+		$sql = 'select sum(invoicePrice) as invoicePrice ,trainId
+				from ' . $this->_table . ' 
+						where trainId in ('.$itidSql.') and status=2 and printStatus=1 and (untreadStatus =0 or untreadStatus=3)
+						 GROUP BY trainId';
+		$query = Doo::db ()->query ( $sql );
+		return $result = $query->fetchAll ();
+	}
+	
+	function sumOfInvoiceRecelvablesTrain($itidSql){
+		$sql = 'select sum(b.receivablesPrice) as receivablesPrice ,a.trainId,count(*) as count
+				from ' . $this->_table . ' as a left join CLD_invoiceReceivables as b on find_in_set(a.irid,b.irid)
+				where a.trainId in ('.$itidSql.') and a.status=2 and a.printStatus=1 and (a.untreadStatus =0 or a.untreadStatus=3) and a.irid!="" 
+				GROUP BY a.trainId';
+		$query = Doo::db ()->query ( $sql );
+		return $result = $query->fetchAll ();
+	}
+	
+	
+	/**
+	 * 根据仓库ID获得发票
+	 * @param string $Istoreid
+	 * @return unknown
+	 */
+	public function getInvoiceByIstoreid($Istoreid = "", $select = "") {
+		if (empty ( $Istoreid ))
+			return array ();
+		
+		$condition = array (
+				'where' => "isid in ( " . $Istoreid . ")",
+				'asArray' => TRUE 
+		);
+		
+		if (! empty ( $select ))
+			$condition += array (
+					'select' => $select 
+			);
+		
+		$detail = $this->find ( $condition );
+		
+		return $detail;
+	}
+	
+	/**
 	 * 获取单个可以打印的发票数据
 	 * @param number $iid 发票id
 	 * @param number $select 需要获取的字段,为空获取全部数据
@@ -413,6 +473,32 @@ class invoice extends DooModel {
 		}
 		return $lid;
 	}
+	
+	/**
+	 * 根据参数字段批量更新相应字段(主键ID必须传)
+	 * @param array $item 相关需要更新的字段信息
+	 * @return number 返回发票ID
+	 */
+	public function BatchInvoiceByCondition($item = array(), $iid = "") {
+		$lid = 0;
+		
+		if (is_array ( $item ) && ! empty ( $item )) {
+			foreach ( $item as $key => $value ) {
+				$this->$key = $value;
+			}
+			
+			if (! empty ( $iid )) {
+				$condition = array (
+						'where' => "iid in (" . $iid . ")",
+						'asArray' => TRUE 
+				);
+				$this->update ( $condition );
+			} else
+				$lid = $this->update ();
+		}
+		return $lid;
+	}
+	
 	/**
 	 * 根据管理组和发票当前状态获得打印发票数据;其中当iid为空时获取所有发票数据,反之获取1条数据
 	 * @param number $sid 管理组人员ID
@@ -541,8 +627,8 @@ class invoice extends DooModel {
 	public function getPostByInvoice($postStatus = 0) {
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
-		$list = $this->find ( array (
-				'where' => "postStatus=" . $postStatus . " and printStatus=1 and untreadStatus=0  and doPost=1 and status=2 and isDelete=0",
+		$list = $this->find ( array ( // and untreadStatus=0
+				'where' => "postStatus=" . $postStatus . " and printStatus=1   and doPost=1 and status=2 and isDelete=0",
 				'limit' => 7,
 				'asArray' => TRUE 
 		) );
@@ -569,7 +655,7 @@ class invoice extends DooModel {
 		Doo::loadClass ( 'XDeode' );
 		$XDeode = new XDeode ( 5 );
 		if (empty ( $iid )) {
-			$list = $this->find ( array (// printStatus=1 and
+			$list = $this->find ( array ( // printStatus=1 and
 					'where' => " untreadStatus=" . $untreadStatus . " and status=2 ",
 					'asArray' => TRUE 
 			) );
@@ -630,11 +716,11 @@ class invoice extends DooModel {
 		
 		foreach ( $list as $key => $value ) {
 			$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
-			$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
+			$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationByStatus ( $value ['iid'], 2 );
 		}
 		return $list;
 	}
-	function getInvoiceByUntreadStatusPage($limit = 0, $con = "", $desc = 'desc') {
+	function getInvoiceByUntreadStatusPage($limit = 0, $con = "", $desc = 'desc',$olStatus="desc") {
 		if (empty ( $limit ) || empty ( $con ))
 			return array ();
 		
@@ -652,6 +738,7 @@ class invoice extends DooModel {
 		$invoiceOperationLog = new invoiceOperationLog ();
 		
 		foreach ( $list as $key => $value ) {
+			
 			$list [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
 			$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
 			
@@ -664,8 +751,14 @@ class invoice extends DooModel {
 			}
 			
 			$list [$key] ['irList'] = $invoiceReceivables->getInvoiceReceivablesInIridString ( $value ['irid'] );
-			$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
+			
+			if ($olStatus=='desc')
+				$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid ( $value ['iid'], 'desc' );
+			else 
+				$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationByStatus ( $value ['iid'], $olStatus );
+			
 			$list [$key] ['OperationLog'] = $invoiceOperationLog->getInvoiceOperationByStatus ( $value ['iid'], 6 );
+			//print_r($list [$key] ['OperationLog']);
 			$list [$key] ['sumPrice'] = 0;
 			if (! empty ( $list [$key] ['irList'] ))
 				$list [$key] ['sumPrice'] = $list [$key] ['irList'] [0] ['sumPrice'];
@@ -684,7 +777,6 @@ class invoice extends DooModel {
 			$list [$key] ['lossShow'] = false;
 			if ($lossDate < $nowDate)
 				$list [$key] ['lossShow'] = true;
-			
 		}
 		
 		return $list;

+ 17 - 5
protected/model/invoiceOperationLog.php

@@ -129,9 +129,9 @@ class invoiceOperationLog extends DooModel {
 	 * @param string $desc
 	 * @return unknown
 	 */
-	public function getInvoiceOperationByDropped($iid = 0,$desc = 'desc') {
+	public function getInvoiceOperationByDropped($iid = 0, $desc = 'desc') {
 		$list = $this->getOne ( array (
-				'where' => ' iid=' . $iid.' and status=3',
+				'where' => ' iid=' . $iid . ' and status=3',
 				$desc => 'lid',
 				'asArray' => true 
 		) );
@@ -145,15 +145,27 @@ class invoiceOperationLog extends DooModel {
 	 * @param string $desc
 	 * @return unknown
 	 */
-	public function getInvoiceOperationByStatus($iid = 0,$status = 0,$desc = 'desc') {
+	public function getInvoiceOperationByStatus($iid = 0, $status = 0, $desc = 'desc') {
 		$list = $this->getOne ( array (
-				'where' => 'iid=' . $iid.' and status='.$status,
+				'where' => 'iid=' . $iid . ' and status=' . $status,
 				$desc => 'lid',
-				'asArray' => true
+				'asArray' => true 
 		) );
 		return $list;
 	}
 	
+	/**
+	 * 根据sql执行
+	 * @param string $sql
+	 * @return boolean
+	 */
+	function setInvoiceOperationLogBySql($sql = "") {
+		if (empty ( $sql ))
+			return false;
+		$query = Doo::db ()->query ( $sql );
+		
+		return true;
+	}
 }
 
 ?>

+ 3 - 2
protected/model/invoiceReceivables.php

@@ -63,11 +63,12 @@ class invoiceReceivables extends DooModel {
 		
 		$list = $this->getOne ( array (
 				'select' => ' sum(receivablesPrice) as receivablesPrice ',
-				'where' => " irid in ( " . $iridString . " )",
+				'where' => " irid IN ( " . $iridString . " )",
 				'groupby' => 'iid',
 				'asArray' => TRUE 
 		) );
-		echo $list ['receivablesPrice'].'sdsdf';
+		//echo " irid in ( " . $iridString . " )";
+		//echo $list ['receivablesPrice'].'sdsdf';
 		if (empty ( $list ))
 			return 0;
 		return $list ['receivablesPrice'];

+ 152 - 30
protected/model/invoiceTraining.php

@@ -52,70 +52,192 @@ class invoiceTraining extends DooModel {
 		}
 		return $itid;
 	}
-	
-	function getInvoiceTrainingByTodo($select = ""){
+	function getInvoiceTrainStatistics() {
+		$sql = 'select sum(invoicePrice) as invoicePrice ,trainId
+				from CLD_invoice
+				where trainId !=0 and status=2 and printStatus=1 and (untreadStatus =0 or untreadStatus=3)
+				GROUP BY status';
+		$query = Doo::db ()->query ( $sql );
+		$result = $query->fetchAll ();
+		
+		if (!empty($result))
+			$detail=array('invoicePrice'=>$result[0]['invoicePrice']);
+		else 
+			$detail=array('invoicePrice'=>0);
+		//print_r($result);
+		
+		$sql = 'select sum(b.receivablesPrice) as receivablesPrice ,a.trainId,count(*) as count
+				from CLD_invoice as a left join CLD_invoiceReceivables as b on find_in_set(a.irid,b.irid)
+				where a.trainId !=0 and a.status=2 and a.printStatus=1 and (a.untreadStatus =0 or a.untreadStatus=3) and a.irid!=""
+				GROUP BY a.status';
+		$query = Doo::db ()->query ( $sql );
+		$result = $query->fetchAll ();
+		
+		if (!empty($result)){
+			$detail+=array('receivablesPrice'=>$result[0]['receivablesPrice']);
+			$detail+=array('rPrice'=>$detail['invoicePrice']-$result[0]['receivablesPrice']);
+			
+		}else{
+			$detail+=array('receivablesPrice'=>0);
+			$detail+=array('rPrice'=>$detail['invoicePrice']);
+		}
+		return $detail;
+	}
+	function getInvoiceTrainingByTodo($select = "", $sid = 0) {
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
 		Doo::loadModel ( 'L_category' );
 		$lCategory = new L_category ();
 		
 		$condition = array (
-				'where' => "status= 0 or status=1 ",
-				'limit'=>8,
-				'asArray' => TRUE
+				'where' => "(status= 0 or status=1) and creator=" . $sid,
+				'limit' => 8,
+				'asArray' => TRUE 
 		);
 		if (! empty ( $select ))
 			$condition += array (
-					'select' => $select
+					'select' => $select 
 			);
-				
-			$list=$this->find (
-					$condition
-					);
-		
-			foreach ($list as $key=>$value){
-				$detail=$staff->getStaffBySid($value['creator']);
-				$list[$key]['staff']=$detail;
-				$detail=$lCategory->getCategoryById($value['cid']);
-				$list[$key]['category']=$detail;
+		
+		$list = $this->find ( $condition );
+		
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$itid = array ();
+		foreach ( $list as $key => $value ) {
+			$list [$key] ['trainingKey'] = $XDeode->encode ( $value ['itid'] );
+			$detail = $staff->getStaffBySid ( $value ['creator'] );
+			$list [$key] ['staff'] = $detail;
+			$detail = $lCategory->getCategoryById ( $value ['cid'] );
+			$list [$key] ['category'] = $detail;
+			array_push ( $itid, $value ['itid'] );
+		}
+		
+		// 获得开票金额合计 入账金额合计 入账完成度
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		
+		$itidSql = implode ( ',', $itid );
+		
+		$invoiceList = $invoice->sumOfinvoiceTrain ( $itidSql );
+		$invoiceRecelvablesList = $invoice->sumOfInvoiceRecelvablesTrain ( $itidSql );
+		// print_r($invoiceRecelvablesList);
+		
+		foreach ( $list as $key => $value ) {
+			foreach ( $invoiceList as $k => $v ) {
+				if ($value ['itid'] == $v ['trainId']) {
+					$list [$key] ['invoiceTotalAmount'] = $v ['invoicePrice'];
+					break;
+				}
+			}
+			foreach ( $invoiceRecelvablesList as $i => $o ) {
+				if ($value ['itid'] == $o ['trainId']) {
+					$list [$key] ['invoiceArriveAmount'] = $o ['receivablesPrice'];
+					$list [$key] ['arriveSchedule'] = "0";
+					if ($value ['invoiceTotal'] != 0)
+						$list [$key] ['arriveSchedule'] = round ( $o ['count'] / $value ['invoiceTotal'] * 100, 2 );
+					
+					break;
+				}
 			}
+		}
 		
-			return $list;
+		return $list;
+	}
+	
+	/**
+	 * 根据参数字段更新相应字段(主键ID必须传)
+	 * @param array $item 相关需要更新的字段信息
+	 * @return number 返回发票ID
+	 */
+	public function setInvoiceTrainByCondition($item = array(), $itid = "") {
+		$lid = 0;
+		
+		if (is_array ( $item ) && ! empty ( $item )) {
+			foreach ( $item as $key => $value ) {
+				$this->$key = $value;
+			}
+			
+			if (! empty ( $isid )) {
+				$condition = array (
+						'where' => "itid in (" . $itid . ")",
+						'asArray' => TRUE 
+				);
+				$this->update ( $condition );
+			} else
+				$lid = $this->update ();
+		}
+		return $lid;
 	}
 	
 	/**
 	 * 根据状态获取培训班
 	 * @param number $status
 	 */
-	function getInvoiceTrainingByStatus($status = 0, $select = "") {
+	function getInvoiceTrainingByStatus($status = 0, $select = "", $sid = 0) {
 		Doo::loadModel ( 'staff' );
 		$staff = new staff ();
 		Doo::loadModel ( 'L_category' );
 		$lCategory = new L_category ();
 		
 		$condition = array (
-			'where' => "status= '" . $status . "' ",
-			'limit'=>8,
-			'asArray' => TRUE 
+				'where' => "status= '" . $status . "' and  creator=" . $sid,
+				'limit' => 8,
+				'asArray' => TRUE 
 		);
 		if (! empty ( $select ))
 			$condition += array (
 					'select' => $select 
 			);
-			
-		$list=$this->find (
-				$condition 
-		);
 		
-		foreach ($list as $key=>$value){
-			$detail=$staff->getStaffBySid($value['creator']);
-			$list[$key]['staff']=$detail;
-			$detail=$lCategory->getCategoryById($value['cid']);
-			$list[$key]['category']=$detail;
+		$list = $this->find ( $condition );
+		
+		foreach ( $list as $key => $value ) {
+			$detail = $staff->getStaffBySid ( $value ['creator'] );
+			$list [$key] ['staff'] = $detail;
+			$detail = $lCategory->getCategoryById ( $value ['cid'] );
+			$list [$key] ['category'] = $detail;
 		}
 		
 		return $list;
 	}
+	
+	/**
+	 * 根据ID获得培训班
+	 * @param number $itid
+	 */
+	function getInvoiceTrainingByItid($itid = 0) {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$itid = $XDeode->decode ( $itid );
+		
+		$detail = array ();
+		if (! empty ( $itid ) && is_numeric ( $itid )) {
+			$detail = $this->getOne ( array (
+					'where' => " itid=" . $itid,
+					'asArray' => TRUE 
+			) );
+		}
+		$detail ['trainingKey'] = '';
+		if (! empty ( $detail ))
+			$detail ['trainingKey'] = $XDeode->encode ( $detail ['itid'] );
+		
+		return $detail;
+	}
+	
+	/**
+	 * 根据ID删除数据
+	 * @param number $itid
+	 */
+	function delInvoiceTrainingByItid($itid = 0) {
+		Doo::loadClass ( 'XDeode' );
+		$XDeode = new XDeode ( 5 );
+		$itid = $XDeode->decode ( $itid );
+		if (! empty ( $itid ) && is_numeric ( $itid ))
+			$this->delete ( array (
+					'where' => 'itid=' . $itid 
+			) );
+	}
 }
 
 ?>

+ 17 - 1
protected/plugin/TemplateTag.php

@@ -271,12 +271,28 @@ function getReceiptCount() {
 	$receipt = new receipt ();
 	Doo::loadClass ( 'XDeode' );
 	$XDeode = new XDeode ( 5 );
+	Doo::loadModel ( 'verify' );
+	$verify = new verify ();
+	
 	$st[0]['sid'] = $XDeode->decode ( $_COOKIE["staff"] );
+	$vidList = array ();
+	$verifyDetail = $verify->find ( array (
+			'where' => ' (staff not like "%\"' . $st [0] ['sid'] . '\",\"ROLE%") and (staff like "%[\"' . $st ['sid'] . '\",%" or staff like "%\"' . $st [0] ['sid'] . '\_%" )',
+			'asArray' => true
+	) );
+	foreach ( $verifyDetail as $key => $value ) {
+		array_push ( $vidList, $value ['vid'] );
+	}
+	$vid = implode ( ",", $vidList );
+	if (empty ( $verifyDetail ))
+		$vid = 0;
+	
+	
 	
 	$dateCondition = " and Year(date) =" . $year;
 	$approvalCondition = ' and (nowStaff like "%,' . $st[0]['sid'] . '%" or nowStaff like "%' . $st[0]['sid'] . ',%" or nowStaff=' . $st[0]['sid'] . ' ) ';
 	$receiptList = $receipt->find ( array (
-			'where' => ' status=' . $status . $dateCondition . $approvalCondition,
+			'where' => ' status=' . $status . $dateCondition . $approvalCondition. ' and verify in (' . $vid . ')',
 			'desc' => 'rid',
 			'asArray' => true 
 	) );

+ 2 - 2
protected/view/admin/approvalExpenses.html

@@ -57,11 +57,11 @@
 	  					<!-- endif -->
 	  					
 	  					<!-- if {{status}}=='done' || {{status}}=='termination' --> 
-	  					<li >
+	  					<li style="display:none" >
 	  					<input type="month" name="date" id="date" style="width:120px" onChange="receiptDate();" value="">
 	  					</li>
 	  					
-	  					<li>
+	  					<li >
 						<select name="year" id="Y" onChange="receiptYear();">
 	  					<!-- include 'year' -->
 	  					</select>

+ 22 - 3
protected/view/admin/invoice.html

@@ -189,7 +189,9 @@
 										</td>
 										<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{myInvoiceUnAccount' value.iidKeyK}}" data-toggle="modal">{{myInvoiceUnAccount' value.invoiceSerial}}</a></td>
 										
-										<td>{{myInvoiceUnAccount' value.printTime}}</td>
+										<td>{{myInvoiceUnAccount' value.printTime}}
+										<a href="#shipping" node-post="expressActual-msg" post-data="{{myInvoiceUnAccount' value.iidKey}}" data-toggle="modal">快递信息</a>
+										
 									</tr>
 									<!-- endloop -->
 									
@@ -441,6 +443,23 @@
 				<div class="modal-body saeaList">
 				<div style='text-align: center' loading-msg='express-msg'></div>
 					<table class="table table-bordered table-condensed">
+					
+					<tbody>
+			<tr>
+				<th colspan="4" class="taC">邮寄快递信息</th>
+			</tr>
+			<tr>
+				<th class="taC" width="150">邮寄申请物品</th><td colspan="3" mailItems-data='express-msg'>合同x1、软件锁x1</td>
+			</tr>
+			<tr>
+				<th class="taC" width="150">邮寄快递物品</th><td colspan="3" actualItems-data='express-msg'>合同x1、软件锁x1</td>
+			</tr>
+			<tr>
+				<th class="taC" width="150">快递单号</th><td colspan="3" expressCompany-data='express-msg'>顺丰快递:<a>123123123123</a></td>
+			</tr>
+			</tbody>
+					
+					<!-- 
 						<tbody>
 							<tr>
 								<th colspan="4" class="taC">申请邮寄信息</th>
@@ -478,9 +497,9 @@
 								<th class="taC" width="100">邮寄物品</th>
 								<td colspan="3" actualItems-data='express-msg'></td>
 							</tr>
-						</tbody>
+						</tbody>-->
 					</table>
-					
+					 
 				</div>
 				<div class="modal-footer">
 					<a href="#" class="button btn-gray" data-dismiss="modal"

+ 5 - 1
protected/view/admin/invoicePost.html

@@ -38,6 +38,7 @@
 										<th class="taC">开票流水号</th>
 										<th class="taC">开票单位(抬头)</th>
 										<th class="taC">开票金额</th>
+										<th class="taC">发票号</th>
 										<th class="taC">提交开票</th>
 										<th class="taC">打印发票</th>
 										<th class="taC" width="120">操作</th>
@@ -56,6 +57,7 @@
 											<!-- else --> <b>¥{{invoiceList' value.invoicePrice}}</b> 
 											<!-- endif -->
 										</td>
+										<td>{{list' value.invoiceNo}}</td>
 										<td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
 										<td>{{invoiceList' value.userName}}&nbsp;{{invoiceList' value.printTime}}</td>
 										<td><a class="button btn-block" node-post="express"
@@ -86,6 +88,7 @@
 										<th class="taC">开票流水号</th>
 										<th class="taC">开票单位(抬头)</th>
 										<th class="taC">开票金额</th>
+										<th class="taC">发票号</th>
 										<th class="taC">提交开票</th>
 										<th class="taC">快递信息</th>
 										<th class="taC">邮寄发票</th>
@@ -104,8 +107,9 @@
 											<!-- else --> <b>¥{{invoiceList' value.invoicePrice}}</b> 
 											<!-- endif -->
 										</td>
+										<td>{{list' value.invoiceNo}}</td>
 										<td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
-											
+										
 										<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>
 									</tr>

+ 2 - 2
protected/view/admin/invoicePostAchieve.html

@@ -41,7 +41,7 @@
 				<div class="saeaList">
 					<table class="table table-hover">
 						<tbody>
-						<tr class="thead"><th>开票流水号</th><th>开票单位(抬头)</th><th>开票金额</th><th>提交开票</th><th>快递信息</th><th>邮寄发票</th><th>操作</th></tr>
+						<tr class="thead"><th>开票流水号</th><th>开票单位(抬头)</th><th>开票金额</th><th>发票号</th><th>提交开票</th><th>快递信息</th><th>邮寄发票</th><th>操作</th></tr>
 						
 						<!-- loop list -->
 						<tr>
@@ -58,7 +58,7 @@
 	                          <b>¥{{list' value.invoicePrice}}</b>
 	                          <!-- endif -->
 							</td>
-							
+							<td>{{list' value.invoiceNo}}</td>
 							<td>{{list' value.categoryName}}{{list' value.userName}} {{list' value.date}}</td>
 							<td>{{invoiceList' value.expressCompany}}:
 							<a href="#shipping" node-post="express-msg" post-data="{{invoicePost' value.iidKey}}" data-toggle="modal">{{invoiceList' value.expressNumber}}</a></td>

+ 8 - 7
protected/view/admin/invoiceTraining.html

@@ -3,6 +3,7 @@
 <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">
@@ -30,9 +31,9 @@
 							<div class="clearfix">
 								<table class="table table-bordered table-condensed">
 									<tbody>
-									<tr><th class="taC">累计培训班</th><td>4</td><th class="taC">累计完成</th><td>3</td></tr>
-									<tr><th class="taC">累计开票金额</th><td>¥838,273.00</td><th class="taC">累计入账金额</th><td>¥838,273.00</td></tr>
-									<tr><th class="taC">累计未入账发票</th><td colspan="3">¥209,484,765.00</td></tr>
+									<tr><th class="taC">累计培训班</th><td>{{trainCount}}</td><th class="taC">累计完成</th><td>{{countArray(itedList)}}</td></tr>
+									<tr><th class="taC">累计开票金额</th><td>¥{{itStatist.invoicePrice}}</td><th class="taC">累计入账金额</th><td>¥{{itStatist.receivablesPrice}}</td></tr>
+									<tr><th class="taC">累计未入账发票</th><td colspan="3">¥{{itStatist.rPrice}}</td></tr>
 									</tbody>
 								</table>
 							</div>
@@ -45,7 +46,7 @@
 									<tr><th class="taC">培训班名称</th><th class="taC">办事处</th><th class="taC">创建</th><th class="taC">开班时间</th><th class="taC" width="90">包含发票</th><th class="taC">开票金额合计</th><th class="taC">入账金额合计</th><th class="taC" width="90">入账完成度</th><th class="taC" width="100">操作</th></tr>
 									<!-- loop itTodoList -->
 									<tr>
-										<td><a href="invoice-batch-detail.html">{{itList' value.trainName}}</a></td>
+										<td><a href="/invoiceTrainingDetail/{{itList' value.trainingKey}}.html">{{itList' value.trainName}}</a></td>
 										<td>{{itList' value.category.0.title}}</td>
 										<td>{{itList' value.staff.username}}</td>
 										<td>{{itList' value.trainDate}}</td>
@@ -55,7 +56,7 @@
 										<td>{{itList' value.arriveSchedule}}%</td>
 										<td>
 										<!-- if {{itList' value.arriveSchedule}}==0 -->
-										<a data-toggle="modal" href="#invalid">删除</a>
+										<a data-toggle="modal" data-key="{{itList' value.trainingKey}}" node-training="del" href="#invalid">删除</a>
 										<!-- endif -->
 										</td>
 									</tr>
@@ -76,7 +77,7 @@
 									<tr><th class="taC">培训班名称</th><th class="taC">办事处</th><th class="taC">创建</th><th class="taC">开班时间</th><th class="taC" width="90">包含发票</th><th class="taC">开票金额合计</th><th class="taC">入账金额合计</th><th class="taC" width="90">入账完成度</th></tr>
 									<!-- loop itedList -->
 									<tr>
-										<td><a href="invoice-batch-detail.html">{{itList' value.trainName}}</a></td>
+										<td><a href="/invoiceTrainingDetail/{{itList' value.trainingKey}}.html">{{itList' value.trainName}}</a></td>
 										<td>{{itList' value.category.0.title}}</td>
 										<td>{{itList' value.staff.username}}</td>
 										<td>{{itList' value.trainDate}}</td>
@@ -140,7 +141,7 @@
 <!--创建培训班-->
 <div class="modal hide fade" id="invalid">
 <form action="invoiceTrainingDelDo"  method="post">
-<input type="hidden" name="trainingKey" value="">
+<input type="hidden" id='trainingKey' name="trainingKey" value="">
 		<div class="modal-dialog ">
 			<div class="modal-content">
 				<div class="modal-header">

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

@@ -28,7 +28,7 @@
 							<!-- if !empty({{untreadInvoice}}) -->
 							<table class="table table-bordered table-condensed">
 								<tbody>
-								<tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">提交退票</th>
+								<tr><th class="taC">开票流水号</th><th class="taC">开票单位(抬头)</th><th class="taC">开票金额</th><th class="taC">发票号</th><th class="taC">提交退票</th>
 								<th class="taC">退票原因</th><th class="taC">退票快递</th><th class="taC" width="120">操作</th></tr>
 								
 								<!-- loop untreadInvoice -->
@@ -48,6 +48,13 @@
                                     <b>¥{{invoiceList' value.invoicePrice}}</b>
                                     <!-- endif -->
                                     </td>
+                                    
+                                    <td>
+                                  
+                                   {{invoiceList' value.invoiceNo}}
+                                   
+                                    </td>
+                                    
                                     <td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
                                     <td>{{invoiceList' value.untreadReason}}</td>
                                     <td>

+ 2 - 1
protected/view/admin/invoiceUntreadIsAchieve.html

@@ -51,7 +51,7 @@
 				<div class="saeaList">
 					<table class="table table-hover">
 						<tbody>
-						<tr class="thead"><th>开票流水号</th><th>开票金额</th><th>开票单位(抬头)</th><th>开票内容</th><th>收款流水号</th><th>收款金额</th><th>入账时间</th><th>申请退票</th></tr>
+						<tr class="thead"><th>开票流水号</th><th>开票金额</th><th>开票单位(抬头)</th><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>
@@ -69,6 +69,7 @@
 	                                    {{list' value.invoiceTitle}}
 	                                    <!-- endif -->
 							</td>
+							<td>{{list' value.invoiceNo}}</td>
 							<td>{{list' value.invoiceElement}}</td>
 							<!-- if empty({{list' value.irList}}) -->
 							<td></td>

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

@@ -2,4 +2,4 @@
 <option <!-- if {{year}}==2015 --> selected <!-- endif --> value="2015">2015</option>
 <option <!-- if {{year}}==2016 --> selected <!-- endif --> value="2016">2016</option>
 <option <!-- if {{year}}==2017 --> selected <!-- endif --> value="2017">2017</option>
-<option <!-- if {{year}}==2018 --> selected <!-- endif --> value="2017">2018</option>
+<option <!-- if {{year}}==2018 --> selected <!-- endif --> value="2018">2018</option>

+ 51 - 7
protected/view/index2.html

@@ -15,9 +15,23 @@
 	  			<div class="centerPanel">
 					<div class="bigAddup" data-placement="bottom" data-toggle="ctooltip" data-original-title="客户总数">客户:{{sum}}</div>
 					<ul class="sortAddup" data-placement="right" data-toggle="ctooltip" data-original-title="创建客户数">
-						<li><span>{{max.0.1}}:</span>{{max.0.0}}</li>
-						<li><span>{{max.1.1}}:</span>{{max.1.0}}</li>
-						<li><span>{{max.2.1}}:</span>{{max.2.0}}</li>
+						<!-- if !empty({{max}}) -->
+						<li>
+						<!-- if isset({{max.0}}) -->
+						<span>{{max.0.1}}:</span>{{max.0.0}}
+						<!-- endif -->
+						</li>
+						<li>
+						<!-- if isset({{max.1}}) -->
+						<span>{{max.1.1}}:</span>{{max.1.0}}
+						<!-- endif -->
+						</li>
+						<li>
+						<!-- if isset({{max.2}}) -->
+						<span>{{max.2.1}}:</span>{{max.2.0}}
+						<!-- endif -->
+						</li>
+						<!-- endif -->
 						<dl class="hide sec use">
 							<!-- loop max2 -->
 							<dd><span>{{max2' value.1}}:</span>{{max2' value.0}}</dd>
@@ -26,9 +40,21 @@
 					</ul>
 					<div class="bigAddup" data-placement="bottom" data-toggle="ctooltip" data-original-title="锁总数(使用率)">锁:{{Rsum}}({{Ssum}})</div>
 					<ul class="sortAddup" data-placement="right" data-toggle="ctooltip" data-original-title="锁使用率">
-						<li><span>{{useL.0.1}}:</span>{{useL.0.0}}</li>
-						<li><span>{{useL.1.1}}:</span>{{useL.1.0}}</li>
-						<li><span>{{useL.2.1}}:</span>{{useL.2.0}}</li>
+						<li>
+						<!-- if isset({{useL.0}}) -->
+						<span>{{useL.0.1}}:</span>{{useL.0.0}}
+						<!-- endif -->
+						</li>
+						<li>
+						<!-- if isset({{useL.1}}) -->
+						<span>{{useL.1.1}}:</span>{{useL.1.0}}
+						<!-- endif -->
+						</li>
+						<li>
+						<!-- if isset({{useL.2}}) -->
+						<span>{{useL.2.1}}:</span>{{useL.2.0}}
+						<!-- endif -->
+						</li>
 						<dl class="hide sec">
 							<!-- loop useL2 -->
 							<dd><span>{{useL2' value.1}}:</span>{{useL2' value.0}}</dd>
@@ -44,15 +70,33 @@
 								<li class="select <!-- if empty({{sid}}) -->now<!-- endif -->">
 									<select id="cateselect">
 										<!-- loop categorylist2 -->
-										<option value="{{categorylist2' value.cid}}" <!-- if {{categorylist2' value.cid}} == {{cid}} -->selected<!-- endif -->>{{categorylist2' value.title}}</option>
+										
+										<!-- if isset({{categorylist2' value.did}}) -->
+                                        <option value="{{categorylist2' value.cid}}-{{categorylist2' value.did}}" <!-- if {{categorylist2' value.cid}} == {{cid}} &&{{categorylist2' value.did}} == {{did}} -->selected<!-- endif -->>{{categorylist2' value.title}}-{{categorylist2' value.departmentName}}</option>
+                                       	<!-- else -->
+                                       	<option value="{{categorylist2' value.cid}}" <!-- if {{categorylist2' value.cid}} == {{cid}} -->selected<!-- endif -->>{{categorylist2' value.title}}</option>
+                                       	<!-- endif -->
+										
+										
 										<!-- endloop -->
 									</select>
 								</li>
 	  							<!-- loop staffList -->
 	  							<li <!-- if {{staffList' value.sid}}=={{sid}} -->class="now" <!-- endif -->>
+	  							
+	  							
+	  							
+	  	<!-- if !empty({{staffList' value.departmentID}}) -->
+	  								<a href="/index?cid={{staffList' value.cid}}-{{staffList' value.departmentID}}&sid={{staffList' value.sid}}"><div class="avtra"><img src="{{staffList' value.avatar}}_2.jpg"></div>
+	  								<h2>{{staffList' value.username}}<p>{{staffList' value.category}}</p></h2>
+	  								</a>
+	  								<!-- else -->
 	  								<a href="/index?cid={{staffList' value.cid}}&sid={{staffList' value.sid}}"><div class="avtra"><img src="{{staffList' value.avatar}}_2.jpg"></div>
 	  								<h2>{{staffList' value.username}}<p>{{staffList' value.category}}</p></h2>
 	  								</a>
+	  								<!-- endif -->
+	  							
+	  								</a>
 	  							</li>
 	  							<!-- endloop -->
 	  							

+ 183 - 132
protected/view/indexLongle.html

@@ -1,26 +1,188 @@
 <!-- include 'header' -->
 
+<script src="<?= WEB_SITE_GLOBAL ?>js/echarts.min.js"></script>
 
-<script src="http://s1.bdstatic.com/r/www/cache/ecom/esl/1-6-10/esl.js"></script>
-	<script type="text/javascript">
-        // 路径配置
-        require.config({
-            paths:{ 
-                'echarts' : 'http://echarts.baidu.com/build/echarts'
-            }
-        });
+	
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include 'menu' -->
+				</ul>
+			</div>
+		</div>
+		<div class="warpContent">
+	  		<div class="infoCenter">
+	  			<div class="centerPanel">
+					<div class="bigAddup" data-placement="bottom" data-toggle="ctooltip" data-original-title="客户总数">客户:{{sum}}</div>
+					<ul class="sortAddup" data-placement="right" data-toggle="ctooltip" data-original-title="创建客户数">
+						<!-- if !empty({{max}}) -->
+						<li>
+						<!-- if isset({{max.0}}) -->
+						<span>{{max.0.1}}:</span>{{max.0.0}}
+						<!-- endif -->
+						</li>
+						<li>
+						<!-- if isset({{max.1}}) -->
+						<span>{{max.1.1}}:</span>{{max.1.0}}
+						<!-- endif -->
+						</li>
+						<li>
+						<!-- if isset({{max.2}}) -->
+						<span>{{max.2.1}}:</span>{{max.2.0}}
+						<!-- endif -->
+						</li>
+						<!-- endif -->
+						<dl class="hide sec use">
+							<!-- loop max2 -->
+							<dd><span>{{max2' value.1}}:</span>{{max2' value.0}}</dd>
+							<!-- endloop -->
+						</dl>
+					</ul>
+					<div class="bigAddup" data-placement="bottom" data-toggle="ctooltip" data-original-title="锁总数(使用率)">锁:{{Rsum}}({{Ssum}})</div>
+					<ul class="sortAddup" data-placement="right" data-toggle="ctooltip" data-original-title="锁使用率">
+						<li>
+						<!-- if isset({{useL.0}}) -->
+						<span>{{useL.0.1}}:</span>{{useL.0.0}}
+						<!-- endif -->
+						</li>
+						<li>
+						<!-- if isset({{useL.1}}) -->
+						<span>{{useL.1.1}}:</span>{{useL.1.0}}
+						<!-- endif -->
+						</li>
+						<li>
+						<!-- if isset({{useL.2}}) -->
+						<span>{{useL.2.1}}:</span>{{useL.2.0}}
+						<!-- endif -->
+						</li>
+						<dl class="hide sec">
+							<!-- loop useL2 -->
+							<dd><span>{{useL2' value.1}}:</span>{{useL2' value.0}}</dd>
+							<!-- endloop -->
+						</dl>
+					</ul>
+	  			</div>
+	  			<div class="centerRecord">
+	  				<div class="sideBar">
+	  					<div class="mostTab"></div>
+	  					<div class="mostList autoHeightI1" data-placement="top" data-toggle="ctooltip" data-original-title="滚动条隐藏了,用鼠标滚轮下拉吧">
+	  						<ul class="item">
+                                <li class="select <!-- if empty({{sid}}) -->now<!-- endif -->">
+                                    <select id="cateselect">
+                                        <!-- loop categorylist2 -->
+                                        
+                                        <!-- if isset({{categorylist2' value.did}}) -->
+                                        <option value="{{categorylist2' value.cid}}-{{categorylist2' value.did}}" <!-- if {{categorylist2' value.cid}} == {{cid}} &&{{categorylist2' value.did}} == {{did}} -->selected<!-- endif -->>{{categorylist2' value.title}}-{{categorylist2' value.departmentName}}</option>
+                                       	<!-- else -->
+                                       	<option value="{{categorylist2' value.cid}}" <!-- if {{categorylist2' value.cid}} == {{cid}} -->selected<!-- endif -->>{{categorylist2' value.title}}</option>
+                                       	<!-- endif -->
+                                        
+                                        
+                                        
+                                        <!-- endloop -->
+                                    </select>
+                                </li>
+	  							<!-- loop staffList -->
+	  							<li <!-- if {{staffList' value.sid}}=={{sid}} -->class="now" <!-- endif -->>
+	  								
+	  								
+	  								<!-- if !empty({{staffList' value.departmentID}}) -->
+	  								<a href="/longleStatistics?cid={{staffList' value.cid}}-{{staffList' value.departmentID}}&sid={{staffList' value.sid}}"><div class="avtra"><img src="{{staffList' value.avatar}}_2.jpg"></div>
+	  								<h2>{{staffList' value.username}}<p>{{staffList' value.category}}</p></h2>
+	  								</a>
+	  								<!-- else -->
+	  								<a href="/longleStatistics?cid={{staffList' value.cid}}&sid={{staffList' value.sid}}"><div class="avtra"><img src="{{staffList' value.avatar}}_2.jpg"></div>
+	  								<h2>{{staffList' value.username}}<p>{{staffList' value.category}}</p></h2>
+	  								</a>
+	  								<!-- endif -->
+	  								
+	  							</li>
+	  							<!-- endloop -->
+	  						</ul>
+	  					</div>
+	  				</div>
+	  				<div class="dateRecord">
+						<div class="dateTab"><a href="/logStatistics" class="now">统计</a><a href="/index">记录</a></div>
+						<div class="dateList autoHeightI1">
+						<div class="chartTab"><ul class="tButton"><li  >
+						<!-- if empty({{did}}) -->
+						<a href="/logStatistics?cid={{cid}}">通信录</a>
+						<!-- else -->
+						<a href="/logStatistics?cid={{cid}}-{{did}}">通信录</a>
+						<!-- endif -->
+						</li><li class="now"><a  >锁</a></li></ul></div>
+						
+							<div class="warpCharts">
+			        <!--图表1-->
+			        <div id="chartContainer1" style="height: 300px; width: 100%;">
+			        </div>
+			        <!--图表1-->
+			        <div class="clearfix">
+			        
+			        
+			        <form action="/longleStatistics" id="LST" method="post">
+			        
+			        <div style="text-align:center">
+			        <!-- if !empty({{sid}}) -->
+			        	<select name="district" onchange="longleDi()">
+			        		<!-- loop districtHtml -->
+			        		<option <!-- if {{districtHtml' value.id}}=={{districtH}} --> selected <!-- endif --> value="{{districtHtml' value.id}}">{{districtHtml' value.name}}</option>
+			        		<!-- endloop -->
+			        		
+			        	</select>
+			        	 & 
+			        	 <input type="hidden" name="sid" value="{{sid}}">
+			        <!-- endif -->
+				        <select  name="status" onchange="longleSt()">
+					        <option <!-- if {{status}}==4 --> selected <!-- endif --> value="4">借出</option>
+					        <option <!-- if {{status}}==5 --> selected <!-- endif --> value="5">销售</option>
+					        <option <!-- if {{status}}==6 --> selected <!-- endif --> value="6">赠送</option>
+				        </select>
+			        </div>
+			        <!--图表2-->
+			        <div class="fL" id="chartContainer2" style="height: 300px; width: 50%;">
+			        </div>
+			        <!--图表2-->
+			        <!--图表3-->
+			        <div  class="fR"  id="chartContainer3" style="height: 300px; width: 50%;">
+			        </div>
+			        <!--图表3-->
+			        </form>
+			        
+			        </div>
+			        </div>
+				  		</div>
+	  				</div>
+	  			</div>
+	  		</div>
+		</div>
+	</div>
+	
+	
+<script type="text/javascript">autoFlashHeight();</script>
+<script type="text/javascript">
+//         // 路径配置
+//         require.config({
+//             paths:{ 
+//                 'echarts' : 'http://echarts.baidu.com/build/echarts'
+//             }
+//         });
         
-        // 使用
-        require(
-            [
-                'echarts',
-                'echarts/chart/pie', // 使用柱状图就加载bar模块,按需加载
-                'echarts/chart/bar'
-            ],
-            function(ec) {
+//         // 使用
+//         require(
+//             [
+//                 'echarts',
+//                 'echarts/chart/pie', // 使用柱状图就加载bar模块,按需加载
+//                 'echarts/chart/bar'
+//             ],
+//             function(ec) {
                 //1 最近30天客户数量与记录趋势//
                 // 基于准备好的dom,初始化echarts图表
-                var myChart = ec.init(document.getElementById('chartContainer1'));   
+                var myChart = echarts.init(document.getElementById('chartContainer1'));
+                //var myChart = ec.init(document.getElementById('chartContainer1'));   
                 var option = {
                           color:['#e9af68','#57b7b6','#e4575a','#959eac','#ffa500',
                           '#d38b70','#8fb7cf','#cd5c5c','#5c616b','#40e0d0',
@@ -105,7 +267,8 @@
                 //1 最近30天客户数量与记录趋势//
                 //2 最近30天客户数量地域//
                 // 基于准备好的dom,初始化echarts图表
-                var myChart = ec.init(document.getElementById('chartContainer2'));   
+                 var myChart = echarts.init(document.getElementById('chartContainer2'));
+               // var myChart = ec.init(document.getElementById('chartContainer2'));   
                 var option = {                          
                 	color:['#e9af68','#57b7b6','#e4575a','#959eac','#ffa500',
                           '#d38b70','#8fb7cf','#cd5c5c','#5c616b','#40e0d0',
@@ -200,8 +363,8 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
                 myChart.setOption(option); 
                     
                 //3 单位地区分布//                
-            }
-        );
+//             }
+//         );
         
         function longleSt(){
         	 var form = $('#LST'); 
@@ -217,118 +380,6 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
         
     </script>
 
-<body>
-	<div class="mainLayout">
-		<div class="mainMenu">
-			<div class="menuItem">
-				<a href="#" class="mLogo">CLD</a>
-				<ul>
-					<!-- include 'menu' -->
-				</ul>
-			</div>
-		</div>
-		<div class="warpContent">
-	  		<div class="infoCenter">
-	  			<div class="centerPanel">
-					<div class="bigAddup" data-placement="bottom" data-toggle="ctooltip" data-original-title="客户总数">客户:{{sum}}</div>
-					<ul class="sortAddup" data-placement="right" data-toggle="ctooltip" data-original-title="创建客户数">
-						<li><span>{{max.0.1}}:</span>{{max.0.0}}</li>
-						<li><span>{{max.1.1}}:</span>{{max.1.0}}</li>
-						<li><span>{{max.2.1}}:</span>{{max.2.0}}</li>
-						<dl class="hide sec use">
-							<!-- loop max2 -->
-							<dd><span>{{max2' value.1}}:</span>{{max2' value.0}}</dd>
-							<!-- endloop -->
-						</dl>
-					</ul>
-					<div class="bigAddup" data-placement="bottom" data-toggle="ctooltip" data-original-title="锁总数(使用率)">锁:{{Rsum}}({{Ssum}})</div>
-					<ul class="sortAddup" data-placement="right" data-toggle="ctooltip" data-original-title="锁使用率">
-						<li><span>{{useL.0.1}}:</span>{{useL.0.0}}</li>
-						<li><span>{{useL.1.1}}:</span>{{useL.1.0}}</li>
-						<li><span>{{useL.2.1}}:</span>{{useL.2.0}}</li>
-						<dl class="hide sec">
-							<!-- loop useL2 -->
-							<dd><span>{{useL2' value.1}}:</span>{{useL2' value.0}}</dd>
-							<!-- endloop -->
-						</dl>
-					</ul>
-	  			</div>
-	  			<div class="centerRecord">
-	  				<div class="sideBar">
-	  					<div class="mostTab"></div>
-	  					<div class="mostList autoHeightI1" data-placement="top" data-toggle="ctooltip" data-original-title="滚动条隐藏了,用鼠标滚轮下拉吧">
-	  						<ul class="item">
-                                <li class="select <!-- if empty({{sid}}) -->now<!-- endif -->">
-                                    <select id="cateselect">
-                                        <!-- loop categorylist2 -->
-                                        <option value="{{categorylist2' value.cid}}" <!-- if {{categorylist2' value.cid}} == {{cid}} -->selected<!-- endif -->>{{categorylist2' value.title}}</option>
-                                        <!-- endloop -->
-                                    </select>
-                                </li>
-	  							<!-- loop staffList -->
-	  							<li <!-- if {{staffList' value.sid}}=={{sid}} -->class="now" <!-- endif -->>
-	  								<a href="/longleStatistics?cid={{staffList' value.cid}}&sid={{staffList' value.sid}}"><div class="avtra"><img src="{{staffList' value.avatar}}_2.jpg"></div>
-	  								<h2>{{staffList' value.username}}<p>{{staffList' value.category}}</p></h2>
-	  								</a> 
-	  								
-	  							</li>
-	  							<!-- endloop -->
-	  						</ul>
-	  					</div>
-	  				</div>
-	  				<div class="dateRecord">
-						<div class="dateTab"><a href="/logStatistics" class="now">统计</a><a href="/index">记录</a></div>
-						<div class="dateList autoHeightI1">
-						<div class="chartTab"><ul class="tButton"><li  ><a href="/logStatistics">通信录</a></li><li class="now"><a  >锁</a></li></ul></div>
-						
-							<div class="warpCharts">
-			        <!--图表1-->
-			        <div id="chartContainer1" style="height: 300px; width: 100%;">
-			        </div>
-			        <!--图表1-->
-			        <div class="clearfix">
-			        
-			        
-			        <form action="/longleStatistics" id="LST" method="post">
-			        
-			        <div style="text-align:center">
-			        <!-- if !empty({{sid}}) -->
-			        	<select name="district" onchange="longleDi()">
-			        		<!-- loop districtHtml -->
-			        		<option <!-- if {{districtHtml' value.id}}=={{districtH}} --> selected <!-- endif --> value="{{districtHtml' value.id}}">{{districtHtml' value.name}}</option>
-			        		<!-- endloop -->
-			        		
-			        	</select>
-			        	 & 
-			        	 <input type="hidden" name="sid" value="{{sid}}">
-			        <!-- endif -->
-				        <select  name="status" onchange="longleSt()">
-					        <option <!-- if {{status}}==4 --> selected <!-- endif --> value="4">借出</option>
-					        <option <!-- if {{status}}==5 --> selected <!-- endif --> value="5">销售</option>
-					        <option <!-- if {{status}}==6 --> selected <!-- endif --> value="6">赠送</option>
-				        </select>
-			        </div>
-			        <!--图表2-->
-			        <div class="fL" id="chartContainer2" style="height: 300px; width: 50%;">
-			        </div>
-			        <!--图表2-->
-			        <!--图表3-->
-			        <div  class="fR"  id="chartContainer3" style="height: 300px; width: 50%;">
-			        </div>
-			        <!--图表3-->
-			        </form>
-			        
-			        </div>
-			        </div>
-				  		</div>
-	  				</div>
-	  			</div>
-	  		</div>
-		</div>
-	</div>
-	
-	
-<script type="text/javascript">autoFlashHeight();</script>
 <script>
     $('#cateselect').change(function(){
         window.location.href = "/longleStatistics?cid="+$(this).val();

+ 10 - 3
protected/view/indexStat.html

@@ -1,6 +1,7 @@
 <!-- include 'header' -->
 
 
+
 <script src="http://s1.bdstatic.com/r/www/cache/ecom/esl/1-6-10/esl.js"></script>
 	<script type="text/javascript">
         // 路径配置
@@ -14,8 +15,8 @@
         require(
             [
                 'echarts',
-                'echarts/chart/pie', // 使用柱状图就加载bar模块,按需加载
-                'echarts/chart/bar'
+                 'echarts/chart/pie', // 使用柱状图就加载bar模块,按需加载
+                 'echarts/chart/bar'
             ],
             function(ec) {
                 //1 最近30天客户数量与记录趋势//
@@ -307,7 +308,13 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
 	  				<div class="dateRecord">
 						<div class="dateTab"><a href="/logStatistics" class="now">统计</a><a href="/index?cid={{cid}}&sid={{sid}}">记录</a></div>
 						<div class="dateList autoHeightI1">
-						<div class="chartTab"><ul class="tButton"><li class="now">通信录</li><li><a href="/longleStatistics">锁</a></li></ul></div>
+						<div class="chartTab"><ul class="tButton"><li class="now">通信录</li><li>
+						<!-- if empty({{did}}) -->
+						<a href="/longleStatistics?cid={{cid}}">锁</a>
+						<!-- else -->
+						<a href="/longleStatistics?cid={{cid}}-{{did}}">锁</a>
+						<!-- endif -->
+						</li></ul></div>
 						
 							<div class="warpCharts">
 			        <!--图表1-->