Browse Source

index.js报错问题

caipin 8 years ago
parent
commit
6e0cfe8c5c

+ 0 - 328
global/js/index.js

@@ -1579,335 +1579,7 @@ $(function() {
 	
 	a();
 	
-	$("#tags").blur(function(){
-		
-		var url="/checkClient";
-		
-		var name=$(this).val();
-		
-		$.ajax({
-			url:url,
-			type: "post",
-			cache: false,
-			dataType: "json",
-			data: {
-				name:name
-			},
-			global: true,
-			success: function(data){
-				
-				if(data.success){
-					$("#tags").css("background-color","#fff");
-				}else{
-					$("#tags").css("background-color","#f15b6c");
-				}
-			},
-			error:function(err){
-				$("#tags").css("background-color","#f15b6c");
-			}
-			});
-		
-		
-	});
-	
-	$("#tags").autocomplete({
-        source: function( request, response ) {
-            $.ajax({
-                url: "/searchClient",
-                dataType: "json",
-                data:{
-                    searchDbInforItem: request.term
-                },
-                success: function( data ) {
-                	
-                    response( $.map( data, function( item ) {
-                    	
-                        return {
-                            name:item.clientname+"-"+item.companyname,
-                            
-                            value: item.clientname+"-"+item.companyname
-                        }
-                    }));
-                }
-            });
-        },
-        minLength: 1,
-        select: function( event, ui ) {
-            $("#tags").val(ui.item.dbId);
-            
-        }
-    });
-
-	$("#tags2").blur(function(){
-		
-		var url="/checkClient";
-		
-		var name=$(this).val();
-		
-		$.ajax({
-			url:url,
-			type: "post",
-			cache: false,
-			dataType: "json",
-			data: {
-				name:name
-			},
-			global: true,
-			success: function(data){
-				
-				if(data.success){
-					$("#tags2").css("background-color","#fff");
-				}else{
-					$("#tags2").css("background-color","#f15b6c");
-				}
-			},
-			error:function(err){
-				$("#tags2").css("background-color","#f15b6c");
-			}
-			});
-		
-		
-	});
-	
-	$( "#tags2" ).autocomplete({
-        source: function( request, response ) {
-            $.ajax({
-                url: "/searchClient",
-                dataType: "json",
-                data:{
-                    searchDbInforItem: request.term
-                },
-                success: function( data ) {
-                	
-                    response( $.map( data, function( item ) {
-                    	
-                        return {
-                            name:item.clientname+"-"+item.companyname,
-                            
-                            value: item.clientname+"-"+item.companyname
-                        }
-                    }));
-                }
-            });
-        },
-        minLength: 1,
-        select: function( event, ui ) {
-        	//var str=ui.item.dbId;console.log(str);
-        	//var str2=str.split(" ");
-           $("#tags2").val(ui.item.dbId);
-            
-        }
-    });
-
-	
-$("#tags3").blur(function(){
-		
-		var url="/checkLongle";
-		
-		var name=$(this).val();
-		
-		$.ajax({
-			url:url,
-			type: "post",
-			cache: false,
-			dataType: "json",
-			data: {
-				name:name
-			},
-			global: true,
-			success: function(data){
-				
-				if(data.success){
-					$("#tags3").css("background-color","#fff");
-				}else{
-					$("#tags3").css("background-color","#f15b6c");
-				}
-			},
-			error:function(err){
-				$("#tags3").css("background-color","#f15b6c");
-			}
-			});
-		
-		
-	});
-	
-	$( "#tags3" ).autocomplete({
-        source: function( request, response ) {
-            $.ajax({
-                url: "/searchLongle",
-                dataType: "json",
-                data:{
-                    searchDbInforItem: request.term
-                },
-                success: function( data ) {
-                	
-                    response( $.map( data, function( item ) {
-                    	
-                        return {
-                            name:item.key_num+"-"+item.product,
-                            
-                            value: item.key_num+"-"+item.product
-                        }
-                    }));
-                }
-            });
-        },
-        max: 12,
-        minLength: 3,
-        select: function( event, ui ) {
-            $("#tags3").val(ui.item.dbId);
-            
-        }
-    });
-	
-	
-	$("#tags4").blur(function(){
-		
-		var url="/checkClient";
-		
-		var name=$(this).val();
-		
-		$.ajax({
-			url:url,
-			type: "post",
-			cache: false,
-			dataType: "json",
-			data: {
-				name:name
-			},
-			global: true,
-			success: function(data){
-				
-				if(data.success){
-					$("#tags4").css("background-color","#fff");
-				}else{
-					$("#tags4").css("background-color","#f15b6c");
-				}
-			},
-			error:function(err){
-				$("#tags4").css("background-color","#f15b6c");
-			}
-			});
-		
-		
-	});
-	
-	$( "#tags4" ).autocomplete({
-        source: function( request, response ) {
-            $.ajax({
-                url: "/searchClient",
-                dataType: "json",
-                data:{
-                    searchDbInforItem: request.term
-                },
-                success: function( data ) {
-                	
-                    response( $.map( data, function( item ) {
-                    	
-                        return {
-                            name:item.clientname+"-"+item.companyname,
-                            
-                            value: item.clientname+"-"+item.companyname
-                        }
-                    }));
-                }
-            });
-        },
-        minLength: 1,
-        select: function( event, ui ) {
-        	//var str=ui.item.dbId;console.log(str);
-        	//var str2=str.split(" ");
-           $("#tags4").val(ui.item.dbId);
-            
-        }
-    });
-	
-	
-$("#tags5").blur(function(){
-		
-		var url="/checkCompany";
-		
-		var name=$(this).val();
-		
-		$.ajax({
-			url:url,
-			type: "post",
-			cache: false,
-			dataType: "json",
-			data: {
-				name:name
-			},
-			global: true,
-			success: function(data){
-				
-				if(data.success){
-					$("#tags5").css("background-color","");
-					$("#contactPanelNew").html("<table><tbody><tr><td colspan='4'><input type='hidden' name='cid' value='"+data.data.cid+"'/><input type='submit' value='确定'  class='button' /></td></tr></tbody></table>");
-				}else{
-					$html='	<table><tbody>';
-					
-					$html+='<tr><th>单位传真</th><td><input type="text" name="fax"> </td><th>主页</th><td><input type="text" name="webservice"> </td></tr>';
-					$html+='<tr><th>单位地区</th><td colspan="3"><select name="lv21" id="lv21" onchange="dislv(\'lv21\',22);">';
-					$html+=data.nature['district'];
-					$html+='</select><span id="mlv22"><select><option></option></select></span>';
-					$html+='<span id="mlv23"><select><option></option></select></span>';
-					$html+='</td></tr>';
-					$html+='<tr><th>单位地址</th><td colspan="3"><input type="text" name="address"> </td></tr>';
-					$html+='<tr><th>单位性质</th><td colspan="5">';
-					
-					for(var i=1;i<=data.nature.naturelenght;i++){
-						$html+='<label><input type="checkbox" name="nature[]" value="'+data.nature[i]+'">'+data.nature[i]+'</label>&nbsp;';
-					}
-					
-					$html+='<tr><th>乘车路线</th><td colspan="3"><input type="text" name="ride"> </td></tr>';
-					$html+='<tr><th>地标建筑</th><td colspan="3"><input type="text" name="landmarks"> </td></tr>';
-					$html+='<tr><th>住宿参考</th><td colspan="3"><input type="text" name="stay"> </td></tr>';
-					$html+='<tr><td colspan="4"><input type="submit" value="确定"  class="button" /></td></tr>';
-						
-					$html+='</tbody></table>';
-					
-					$("#contactPanelNew").html($html);
-					$("#tags5").css("background-color","#f15b6c");
-				}
-			},
-			error:function(err){
-				$("#contactPanelNew").html("");
-				$("#tags5").css("background-color","#f15b6c");
-			}
-			});
-		
-		
-	});
 	
-	$( "#tags5" ).autocomplete({
-        source: function( request, response ) {
-            $.ajax({
-                url: "/searchCompany",
-                dataType: "json",
-                data:{
-                    searchDbInforItem: request.term
-                },
-                success: function( data ) {
-                	
-                    response( $.map( data, function( item ) {
-                    	
-                        return {
-                            name:item.companyname+"-"+item.local,
-                            
-                            value: item.companyname+"-"+item.local
-                        }
-                    }));
-                }
-            });
-        },
-        minLength: 1,
-        select: function( event, ui ) {
-        	//var str=ui.item.dbId;console.log(str);
-        	//var str2=str.split(" ");
-           $("#tags5").val(ui.item.dbId);
-            
-        }
-    });
 	
 	$("input[id^='longleStatus_']").click(function() {
 		

+ 3 - 3
protected/controller/InvoiceController.php

@@ -15,10 +15,10 @@ class InvoiceController extends DooController {
 			if (! empty ( $_COOKIE ["staff"] )) {
 				Doo::loadModel ( 'staff' );
 				$staff = new staff ();
-				Doo::loadModel("invoiceManage");
-				$invoiceManage=new invoiceManage();
+				Doo::loadModel ( "invoiceManage" );
+				$invoiceManage = new invoiceManage ();
 				
-				//$invoiceManage
+				// $invoiceManage
 				
 				$this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
 				return "/";

+ 6 - 0
protected/model/invoice.php

@@ -44,6 +44,11 @@ class invoice extends DooModel {
 	 */
 	public $invoicePrice;
 	/**
+	 * 管理组人员:
+	 * @var unknown
+	 */
+	public $moldManage;
+	/**
 	 *
 	 * @var integer $cid 办事处ID
 	 */
@@ -168,6 +173,7 @@ class invoice extends DooModel {
 			'invoiceSerial',
 			'status',
 			'invoicePrice',
+			'moldManage',
 			'cid',
 			'categoryName',
 			'remark',

+ 22 - 11
protected/model/invoiceManage.php

@@ -1,17 +1,27 @@
 <?php
 Doo::loadCore ( 'db/DooModel' );
 /**
- *
+ * 发票相关管理相关信息及其操作业务逻辑
  * @author CP.
  * @version 1.0
- * @namespace
- *
- * @package
- *
+ * @namespace invoice
+ * @package invoiceModel
  */
 class invoiceManage extends DooModel {
+	/**
+	 *
+	 * @var integer $iid 管理组ID
+	 */
 	public $iid;
+	/**
+	 *
+	 * @var string $staff 管理组人员
+	 */
 	public $staff;
+	/**
+	 *
+	 * @var string $mold 管理组名称
+	 */
 	public $mold;
 	public $_table = 'CLD_invoiceManage';
 	public $_primarykey = 'iid';
@@ -21,18 +31,19 @@ class invoiceManage extends DooModel {
 			'mold' 
 	);
 	/**
-	 * 更加类型获取审批组成员
-	 * @return unknown
+	 * 根据管理组获取审批组成员
+	 * @return array|array() 该管理组相关数据,人员数据数组化
 	 */
 	public function getInvoiceByMold($mold = "") {
-		$list = array ();
+		$detail = array ();
 		if (! empty ( $mold )) {
-			$list = $this->find ( array (
-					'where' => 'mold="' . $mold.'"',
+			$detail = $this->getOne ( array (
+					'where' => 'mold="' . $mold . '"',
 					'asArray' => TRUE 
 			) );
+			$detail ['staff'] = json_decode ( $detail ['staff'] );
 		}
-		return $list;
+		return $detail;
 	}
 }
 

+ 11 - 11
protected/plugin/TemplateTag.php

@@ -30,15 +30,18 @@ function isInvoiceMoldShow($sid = 0, $mold = '') {
 		$invoiceManage = new invoiceManage ();
 		$imList = $invoiceManage->getInvoiceByMold($mold);
 		$list=array();
-		foreach ($imList as $key=>$value){
-			$ver=json_decode($value['staff']);
-			foreach ($ver as $k=>$v){
-				array_push($list, $v[0]);
-			}
+		foreach ($imList['staff'] as $k=>$v){
+			array_push($list, $v[0]);
 		}
 		$fileInvoice = file_get_contents ( "protected/config/invoice/invoice.ini" );
 		$fileInvoice = json_decode ( $fileInvoice, true );
-		print_r($fileInvoice);
+		$delIM= explode( ',', $fileInvoice[$mold] );
+		foreach ($delIM as $key=>$value){
+			if (!empty($value))
+					array_push($list, $value);
+		}
+		$list = array_unique ( $list );
+		return inarray($sid,$list);
 	} else
 		return false;
 }
@@ -47,8 +50,7 @@ function getGlobals($var) {
 		getReceiptCount ();
 	elseif ($var == 'NEW2')
 		getExeCount ();
-		// echo $GLOBALS['NEW'].'<br/>';
-	
+	//echo $GLOBALS[$var].'/'.$var.'<br/>';
 	return $GLOBALS [$var];
 }
 function inarray($v1, $v2) {
@@ -128,14 +130,12 @@ function getReceiptCount() {
 	$receipt = new receipt ();
 	
 	$dateCondition = " and Year(date) =" . $year;
-	
-	$approvalCondition = ' and nowStaff like "%' . $_COOKIE ["staff"] . '%" ';
+	$approvalCondition=' and (nowStaff like "%,'.$_COOKIE ["staff"].'%" or nowStaff like "%'.$_COOKIE ["staff"].',%" or nowStaff='.$_COOKIE ["staff"].' ) ';
 	$receiptList = $receipt->find ( array (
 			'where' => ' status=' . $status . $dateCondition . $approvalCondition,
 			'desc' => 'rid',
 			'asArray' => true 
 	) );
-	
 	$GLOBALS ['NEW'] = count ( $receiptList );
 }
 /**

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

@@ -7,6 +7,6 @@
 <li><a href="/adminuser" <!-- if {{memu}}=="adminuser" --> class="selected" <!-- endif -->>员工列表</a></li>
 <li><a href="/adminproduct" <!-- if {{memu}}=="adminproduct" --> class="selected" <!-- endif -->>产品列表</a></li>
 <li><a href="/adminverify" <!-- if {{memu}}=="verify" --> class="selected" <!-- endif -->>报销审查组</a></li>
-<li><a style="display:none" href="/adminInvoice" <!-- if {{memu}}=="invoice" --> class="selected" <!-- endif -->>发票管理</a></li>
+<li><a  href="/adminInvoice" <!-- if {{memu}}=="invoice" --> class="selected" <!-- endif -->>发票管理</a></li>
 <li><a style="display:none" href="/holidaygroup" <!-- if {{memu}}=="holiday" --> class="selected" <!-- endif -->>假期审查组</a></li>
 <!-- endif -->

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

@@ -6,12 +6,12 @@
 	</a></li>
 	<li class="news"><a href="invoice-billing-my.html">我的收款</a></li>
 	<li><a href="invoice-billing.html">收款认领</a></li>
-	
-	
-	
-	
+
+
+
+
 	<li class="topLine"><a href="invoice-input-billing.html">收款录入</a></li>
-	
+
 	<!-- if isInvoiceMoldShow({{staff.0.sid}},'发票审批') -->
 	<li><a
 			<!-- if {{receiptMemu}}=="invoiceApproval" --> class="selected" <!-- endif -->
@@ -19,16 +19,17 @@
 	</a></li>
 	<!-- endif -->
 	
+	<!-- if isInvoiceMoldShow({{staff.0.sid}},'发票打印') -->
 	<li class="news"><a
 			<!-- if {{receiptMemu}}=="invoicePrint" --> class="selected" <!-- endif -->
 			href="/invoicePrint">发票打印
 	</a></li>
-	
+	<!-- endif -->
 	<li class="news"><a
 			<!-- if {{receiptMemu}}=="invoicePost" --> class="selected" <!-- endif -->
 			href="/invoicePost">发票邮寄
 	</a></li>
-	
+
 	<li><a href="invoice-return.html">发票退票</a></li>
 	<li><a href="invoice-dlist-category-year.html">公司汇总</a></li>
 </ul>

+ 1 - 1
protected/view/contacts_client.html

@@ -5,7 +5,7 @@
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.widget.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.position.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.autocomplete.js"></script>
-
+<script src="<?= WEB_SITE_GLOBAL ?>/js/autoTag.js"></script>
 <body>
 	<div class="mainLayout">
 		<div class="mainMenu">

+ 1 - 1
protected/view/contacts_company.html

@@ -5,7 +5,7 @@
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.widget.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.position.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.autocomplete.js"></script>
-
+<script src="<?= WEB_SITE_GLOBAL ?>/js/autoTag.js"></script>
 
 <script>
 function deleteTagCompany(tid,cid,obj){

+ 1 - 1
protected/view/lock_look.html

@@ -6,7 +6,7 @@
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.widget.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.position.js"></script>
 <script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.autocomplete.js"></script>
-
+<script src="<?= WEB_SITE_GLOBAL ?>/js/autoTag.js"></script>
 <body>
 
 	<div class="mainLayout">