Jelajahi Sumber

信息中心,员工筛选修改

caipin 7 tahun lalu
induk
melakukan
5278a7c3f6

+ 2 - 2
global/js/invoice.validator.js

@@ -42,12 +42,12 @@ $(function () {
 	        	return $('#isMail').prop('checked');
 	        }
 	    },
-	    fields: {//tel(invoiceCompany);digits(invoiceCompany)
+	    fields: {//tel(invoiceCompany);digits(invoiceCompany)  
 	    	invoiceTitle: 'required(invoiceTitle);',
 	    	invoiceCompany:'required(invoiceCompany);',
 	    	TIN:'required(invoiceCompany);',
 	    	address:'required(invoiceCompany);',
-	    	phone:'required(invoiceCompany);tel|mobile;',
+	    	phone:'required(invoiceCompany);mobile|tel;',
 	    	bank:'required(invoiceCompany);',
 	    	bankAccount:'required(invoiceCompany);'
 	    	//invoicePrice: 'required; '

+ 1 - 1
global/js/zh-CN.js

@@ -26,7 +26,7 @@
             ,url: [/^(https?|s?ftp):\/\/\S+$/i, "请填写有效的网址"]
             ,qq: [/^[1-9]\d{4,}$/, "请填写有效的QQ号"]
             ,IDcard: [/^\d{6}(19|2\d)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)?$/, "请填写正确的身份证号码"]
-            ,tel: [/^(?:(?:0\d{2,3}[\- ]?[1-9]\d{6,7})|(?:[48]00[\- ]?[1-9]\d{6}))$/, "请填写有效的电话号码"]
+            ,tel: [/^(?:13\d|15\d)\d{5}(\d{3}|\*{3})$/, "请填写有效的电话号码"]//  /^(?:(?:0\d{2,3}[\- ]?[1-9]\d{6,7})|(?:[48]00[\- ]?[1-9]\d{6}))$/
             ,mobile: [/^1[3-9]\d{9}$/, "请填写有效的手机号"]
             ,zipcode: [/^\d{6}$/, "请检查邮政编码格式"]
             ,chinese: [/^[\u0391-\uFFE5]+$/, "请填写中文字符"]

File diff ditekan karena terlalu besar
+ 24 - 8
protected/controller/InvoiceController.php


+ 71 - 8
protected/controller/MainController.php

@@ -428,23 +428,83 @@ class MainController extends DooController {
 		$longle = new longle ();
 		Doo::loadModel ( 'L_category' );
 		$lcategory = new L_category ();
+		Doo::loadModel ( 'department' );
+		$department = new department ();
+		
 		
 		$staffCondition = "";
 		$categorylist2 = array ();
 		if ($this->staff [0] ['cid'] != 12) {
 			$staffCondition = " and cid=" . $this->staff [0] ['cid'];
-			array_push ( $categorylist2, array (
-					'cid' => $this->staff [0] ['cid'],
-					'title' => $this->staff [0] ['category'] 
-			) );
+// 			array_push ( $categorylist2, array (
+// 					'cid' => $this->staff [0] ['cid'],
+// 					'title' => $this->staff [0] ['category'] 
+// 			) );
+			$otherC=$lcategory->getCategoryById($this->staff [0] ['cid'],$this->staff [0] ['othercid']);
+			foreach ($otherC as $value){
+				array_push ( $categorylist2, array (
+						'cid' => $value ['cid'],
+						'title' => $value ['title']
+				) );
+			}
+			
 		} else {
 			$sql = 'SELECT `CLD_L_category`.cid,`CLD_L_category`.title,count(`CLD_staff`.sid) as count FROM `CLD_L_category` left join `CLD_staff` on `CLD_L_category`.cid=`CLD_staff`.cid group by `CLD_staff`.cid HAVING count(`CLD_staff`.sid)>0 order by count(`CLD_staff`.sid) desc';
 			$query = Doo::db ()->query ( $sql );
 			$result = $query->fetchAll ();
 			$categorylist2 = $result;
+			
+			//$otherC=$lcategory->getCategoryById($this->staff [0] ['cid'],$this->staff [0] ['othercid']);
+			
 		}
-		if (! empty ( $cid ))
-			$staffCondition = " and cid=" . $cid;
+		
+		//print_r($categorylist2);
+		
+		//有待优化
+		$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);
+		}
+		//array_unshift($categorylist2,$bakCategory);
+		
+		//print_r($categorylist2);
+		$did=$data ['did']='';
+		
+		$othercateSql='';
+		if (!empty($this->staff [0] ['othercid']))
+			$othercateSql=" or (othercid like '".$this->staff [0] ['othercid']."')";
+		if (! empty ( $cid )){//
+			if(is_numeric($cid))
+				$staffCondition = " and cid=" . $cid.$othercateSql;
+			else {
+				$cdid=explode('-', $cid);
+				$cid=$cdid[0];
+				$data ['did'] =$did= $cdid[1];
+				$staffCondition = " and cid=" . $cdid[0]." and departmentID=".$cdid[1].$othercateSql;
+			}
+		}
+		//echo $staffCondition;
+		//echo $staffCondition;
 			// Doo::db()->beginTransaction();
 		$staffList = $staff->find ( array (
 				'where' => ' username !="admin"' . $staffCondition,
@@ -520,14 +580,17 @@ class MainController extends DooController {
 		
 		$categoryCondition = " and cid=" . $this->staff [0] ['cid'];
 		$sidCondition = "";
-		if (! empty ( $cid ))
+		if (! empty ( $cid )){
 			$categoryCondition = " and cid=" . $cid;
+// 			if (!empty($did))
+// 				$categoryCondition .= " and departmentID=" . $did;
+		}
 		if (! empty ( $sid ))
 			$sidCondition = " and sid=" . $sid;
 		if ($this->staff [0] ['cid'] == 12 && empty ( $cid )) {
 			$categoryCondition = "";
 		}
-		
+		//echo $categoryCondition;
 		// Year(updatetime)=".date('Y')." and Month(updatetime)=".date('m')." date_format(updatetime,"%m-%d")
 		
 		$actionLogClient = $action_log->find ( array (

+ 4 - 3
protected/model/invoice.php

@@ -453,9 +453,9 @@ class invoice extends DooModel {
 			$list ['pendingInvoice'] = array ();
 			$list ['handleInvoice'] = array ();
 			$list ['pendingInvoice'] = $this->find ( array ( // 加入邮件中也为 处理中 已退票
-					'where' => "((status=1) or (status=2 and printStatus=0) or ( status=2 and printStatus=1 and untreadStatus=0 ) or
+					'where' => "((status=1 and untreadStatus=0) or (status=2 and printStatus=0 and untreadStatus=0) or ( status=2 and printStatus=1 and untreadStatus=0 ) or
 					( status=2 and printStatus=1 and untreadStatus=1 and untreadPost=0)
-					or (postStatus=0 and doPost=1 and status=2) )  and sid=" . $sid,
+					or (postStatus=0 and doPost=1 and status=2 and untreadStatus=0) ) and isDelete=0  and sid=" . $sid,
 					'desc' => 'iid',
 					'asArray' => TRUE 
 			) );
@@ -467,7 +467,7 @@ class invoice extends DooModel {
 			$list ['handleInvoice'] = $this->find ( array (
 					// 需求变更 -去除出票状态的数据 or (status=2 and printStatus=1 and untreadStatus=0 ) or (status=2 and printStatus=1 and untreadStatus=2 )
 					// 新加入退票中 需要邮寄的发票
-					'where' => "(status=3 or status=4 or (status=2 and printStatus=1 and untreadStatus=2 ) or ( status=2 and  untreadStatus=1 )  )  and isDelete=0 and sid=" . $sid,
+					'where' => "(status=3 or status=4 or (status=2  and untreadStatus=2 ) or ( status=2 and  untreadStatus=1 )  )  and isDelete=0 and sid=" . $sid,
 					'desc' => 'iid',
 					'asArray' => TRUE 
 			) );
@@ -539,6 +539,7 @@ class invoice extends DooModel {
 		$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",
+				'limit' => 7,
 				'asArray' => TRUE 
 		) );
 		foreach ( $list as $key => $value ) {

+ 4 - 0
protected/model/staff.php

@@ -9,6 +9,8 @@ class staff extends DooModel {
 	public $othercid;
 	public $category;
 	public $othercategory;
+	public $departmentID;
+	public $departmentName;
 	public $gender;
 	public $qq;
 	public $phone;
@@ -31,6 +33,8 @@ class staff extends DooModel {
 			'isadmin',
 			'cid',
 			'othercid',
+			'departmentID',
+			'departmentName',
 			'appDate',
 			'category',
 			'othercategory',

+ 46 - 10
protected/plugin/TemplateTag.php

@@ -56,11 +56,11 @@ function isInvoiceNew($type = "GLOBAL") {
 			'asArray' => TRUE 
 	) );
 	// 我的收款待入账
-	$myClaim = $invoiceReceivables->getOne ( array (
-			'where' => " receivablesStaff like '" . $st[0]['sid'] . "-%' and receivablesCategory like '" . $st [0] ['cid'] . ":%' and bindStatus=0",
-			'desc' => 'irid',
-			'asArray' => TRUE 
-	) );
+// 	$myClaim = $invoiceReceivables->getOne ( array (
+// 			'where' => " receivablesStaff like '" . $st[0]['sid'] . "-%' and receivablesCategory like '" . $st [0] ['cid'] . ":%' and bindStatus=0",
+// 			'desc' => 'irid',
+// 			'asArray' => TRUE 
+// 	) );
 	
 	
 	
@@ -77,14 +77,14 @@ function isInvoiceNew($type = "GLOBAL") {
 	) );
 	// 发票打印
 	$print = $invoice->getOne ( array (
-			'where' => "status=2 and printStatus=0 and moldManage like '%[\"" . $st[0]['sid'] . "\",%'",
+			'where' => "status=2 and printStatus=0 and untreadStatus=0 and moldManage like '%[\"" . $st[0]['sid'] . "\",%'",
 			'desc' => 'iid',
 			'asArray' => TRUE 
 	) );
 	
-	// 发票退票
+	// 发票退票 printStatus=1 and
 	$untread = $invoice->getOne ( array (
-			'where' => " printStatus=1 and untreadStatus=1 and status=2 ",
+			'where' => "  untreadStatus=1 and status=2 ",
 			'asArray' => TRUE 
 	) );
 	
@@ -98,11 +98,47 @@ function isInvoiceNew($type = "GLOBAL") {
 			'untread' => FALSE 
 	);
 	
+	
+	//|| ! empty ( $myClaim )
 	if (!empty($exeGlobal)){
-		if (! empty ( $pendingInvoice ) || ! empty ( $myClaim ) || ! empty ( $approval ) || ! empty ( $post ) || ! empty ( $print ) || ! empty ( $untread ))
+		if (! empty ( $pendingInvoice ))
 			$new ['GLOBAL'] = TRUE;
+		
+		foreach ($exeGlobal as $value){
+			if ($value['mold']=='发票审批'){
+				if(! empty ( $approval )){
+					$new ['GLOBAL'] = TRUE;
+					break;
+				}
+			}
+			
+			if ($value['mold']=='发票打印'){
+				if(! empty ( $print )){
+					$new ['GLOBAL'] = TRUE;
+					break;
+				}
+			}
+			
+			if ($value['mold']=='发票邮寄'){
+				if(! empty ( $post )){
+					$new ['GLOBAL'] = TRUE;
+					break;
+				}
+			}
+			
+			if ($value['mold']=='发票退票'){
+				if(! empty ( $untread )){
+					$new ['GLOBAL'] = TRUE;
+					break;
+				}
+			}
+		}
+		
+// 		print_r($exeGlobal);die;
+// 		if (! empty ( $pendingInvoice )  || ! empty ( $approval ) || ! empty ( $post ) || ! empty ( $print ) || ! empty ( $untread ))
+// 			$new ['GLOBAL'] = TRUE;
 	}else{
-		if (! empty ( $pendingInvoice ) || ! empty ( $myClaim ) )
+		if (! empty ( $pendingInvoice )  )
 			$new ['GLOBAL'] = TRUE;
 	}
 		

+ 5 - 5
protected/view/admin/invoice.html

@@ -66,7 +66,7 @@
 										<!-- endif -->
 										
 										
-										<!-- elseif {{handleInvoice' value.status}}==2 and {{handleInvoice' value.printStatus}}==1 and {{handleInvoice' value.untreadStatus}}==2  -->
+										<!-- elseif {{handleInvoice' value.status}}==2  and {{handleInvoice' value.untreadStatus}}==2  -->
 										<span class="colRed">已退票</span>
 										<!-- elseif {{handleInvoice' value.status}}==2  and {{handleInvoice' value.untreadStatus}}==1  -->
 										<span class="colRed">退票中</span>
@@ -89,12 +89,12 @@
 										</td>
 										<td>{{invoiceList' value.OperationLog.username}} {{invoiceList' value.OperationLog.date}}</td>
 										<td width="">
-										<!-- if {{pendingInvoice' value.status}}==3  -->
+										<!-- if {{pendingInvoice' value.status}}==3 and {{pendingInvoice' value.untreadStatus}}==0  -->
 										<div class="btn-group">
 										<a class="button btn-red  btn-inline" diss-data="{{pendingInvoice' value.iidKey}}" node-invoice="droppedInvoice" data-toggle="modal" href="#invalid">终止开票</a>
 										<a class="button btn-inline" href="/invoiceEdit/{{pendingInvoice' value.iidKeyUrl}}.html">重新提交</a>
 										</div>
-										<!-- elseif {{pendingInvoice' value.status}}==4 -->
+										<!-- elseif {{pendingInvoice' value.status}}==4 and {{pendingInvoice' value.untreadStatus}}==0 -->
 										<a class="button btn-gray btn-block" href="/invoiceDelDo/{{pendingInvoice' value.iidKeyUrl}}.do">从待处理移除</a>
 										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==0 -->
 										<!--废弃
@@ -103,7 +103,7 @@
 										<a class="button btn-green" diss-data="{{pendingInvoice' value.iidKey}}" node-receivalbles="bind" href="#recorded" data-toggle="modal">发票核销</a>
 										</div>
 										-->
-										<!-- elseif {{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==1 and {{pendingInvoice' value.untreadStatus}}==2  -->
+										<!-- elseif {{pendingInvoice' value.status}}==2  and {{pendingInvoice' value.untreadStatus}}==2  -->
 										<a class="button btn-gray btn-block" href="/invoiceDelDo/{{pendingInvoice' value.iidKeyUrl}}.do">从待处理移除</a>
 										
 										<!-- elseif {{handleInvoice' value.status}}==2  and {{handleInvoice' value.untreadStatus}}==1 and {{handleInvoice' value.untreadPost}}==1 -->
@@ -130,7 +130,7 @@
 									<!-- loop invoiceList.pendingInvoice -->
 									<tr>
 										<td>
-										<!-- if ({{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==0) or ({{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.postStatus}}==0 and {{pendingInvoice' value.doPost}}==1 ) -->
+										<!-- if ({{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.printStatus}}==0 and {{pendingInvoice' value.untreadStatus}}==0) or ({{pendingInvoice' value.status}}==2 and {{pendingInvoice' value.untreadStatus}}==0 and {{pendingInvoice' value.postStatus}}==0 and {{pendingInvoice' value.doPost}}==1 ) -->
 										<span class="colBlue">出票中</span>
 										 <!-- elseif {{pendingInvoice' value.status}}==1 -->
 										 <span class="">审核中</span>

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

@@ -194,7 +194,7 @@
 									  <label>
 									    <input type="checkbox" checked="" disabled="">
 									    备注<br>
-									    <textarea style="width:550px" placeholder="备注信息或其他需要邮寄物品请填写在这,写明数量。"></textarea>
+									    <textarea style="width:550px" name="mailItems" placeholder="备注信息或其他需要邮寄物品请填写在这,写明数量。"></textarea>
 									    
 									  </label>
 									</div>

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

@@ -87,7 +87,7 @@
                                     </td>
                                     <td>{{invoiceList' value.categoryName}}{{invoiceList' value.userName}} {{invoiceList' value.date}}</td>
                                     <td>{{invoiceList' value.invoiceNo}}</td>
-                                    <td>{{invoiceList' value.lastApprover.username}}&nbsp;{{invoiceList' value.printTime}}</td>
+                                    <td>{{invoiceList' value.printer}}&nbsp;{{invoiceList' value.printTime}}</td>
                                 </tr>
                                 <!-- endloop -->
 								</tbody>

+ 42 - 7
protected/view/indexStat.html

@@ -225,9 +225,21 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
 					<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><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>
+						<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 -->
@@ -237,9 +249,21 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
 					</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>
@@ -254,16 +278,27 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
 	  						<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>
+                                        <!-- 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="/logStatistics?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="/logStatistics?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>