Browse Source

计量支付
在线审批终审
0条需要审核不现实提示

NoNZero 9 years ago
parent
commit
fdc4edfc7f

+ 5 - 0
protected/class/measureauditact.php

@@ -51,6 +51,11 @@ class MeasureauditAct
         return $this->__measureaudit->find(array('where' => 'auditoruid=? and last=2', 'groupby' => 'pid', 'param' => array($uid), 'asArray' => TRUE));
     }
 
+    public function getAuditProject2($uid)
+    {
+        return $this->__measureaudit->find(array('where' => 'auditoruid=?', 'groupby' => 'pid', 'param' => array($uid), 'asArray' => TRUE));
+    }
+
     public function getProject($uid)
     {
         return $this->__measureaudit->find(array('where' => 'auditoruid=?', 'groupby' => 'pmid,numpname', 'param' => array($uid), 'asArray' => TRUE));

+ 51 - 23
protected/controller/ProjectController.php

@@ -7,6 +7,7 @@ Doo::loadClass('project');
 Doo::loadClass('contractact');
 Doo::loadClass('actmeasure');
 Doo::loadClass('numofperact');
+Doo::loadClass('measureauditact');
 
 /* * proDetail
  * MainController
@@ -15,22 +16,25 @@ Doo::loadClass('numofperact');
  * @author darkredz
  */
 
-class ProjectController extends DooController {
+class ProjectController extends DooController
+{
 
-    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审核</span>', 'checking' => '<span class = "colOrange">审核中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>');
+    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审核</span>', 'checking' => '<span class = "colOrange">审核中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>');
 
-    public function beforeRun($resource, $action) {
+    public function beforeRun($resource, $action)
+    {
         if ($this->auth->getUid()) {
             $uGroups = $this->profile->getProWithUid($this->auth->getUid());
             $falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
             if (!$falg)
                 return Doo::acl()->defaultFailedRoute;
-        }else {
+        } else {
             return Doo::acl()->defaultFailedRoute;
         }
     }
 
-    public function __construct() {
+    public function __construct()
+    {
         $this->auth = new Auth();
         $this->attfile = new attFile();
         $this->profile = new Profile();
@@ -38,16 +42,28 @@ class ProjectController extends DooController {
         $this->contractact = new Contractact();
         $this->actmeasure = new actMeasure();
         $this->numofperact = new NumofperAct();
+        $this->measureauditact = new MeasureauditAct();
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'p';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
+        $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
+        if (isset($mpidArray[0]['pid'])) {
+            foreach ($mpidArray as $key => $value) {
+                // 审批操作按照时间排序多标段
+                $this->data['numofchecking'] += $this->measureauditact->getCountMyChecking($value['pid'], $this->auth->getUid());
+            }
+        }
+        if ($this->data['numofchecking'] == 0) {
+            $this->data['numofchecking'] = null;
+        }
     }
 
     /**
      *
      * @return type
      */
-    public function index() {
+    public function index()
+    {
         if (isset($_POST['pname']) && $_POST['pname']) {
             $this->project->insertProject($this->auth->getUid(), $_POST['pname']);
             return Doo::conf()->APP_URL . 'project/index';
@@ -78,7 +94,8 @@ class ProjectController extends DooController {
         $this->render('w-project', $this->data, TRUE);
     }
 
-    public function proOverview() {
+    public function proOverview()
+    {
         $conArray = $this->contractact->getRowByPid($this->params['pid']);
         $this->data['projectDate'] = '';
         $this->data['conArray'][] = array();
@@ -162,8 +179,8 @@ class ProjectController extends DooController {
         foreach ($this->data['conArray'] as $k => $v) {
             $this->data['conArray'][$k]['pstopnow'] = $this->data['conArray'][$k]['pscurrdone'] = 0;
             $retval = $this->actmeasure->getAllbyStidSum($v['stid']);
-            $contracttotal+=$retval[0]['contracttotal'];
-            $totalstid +=$this->actmeasure->getTotal($v['stid'])['total'];
+            $contracttotal += $retval[0]['contracttotal'];
+            $totalstid += $this->actmeasure->getTotal($v['stid'])['total'];
             $total = $this->actmeasure->getTotal($v['stid'])['total'];
             if ($total) {
                 $this->data['conArray'][$k]['total'] = round($total, 2);
@@ -223,7 +240,8 @@ class ProjectController extends DooController {
         $this->render('w-project-detail', $this->data, TRUE);
     }
 
-    public function proSection() {
+    public function proSection()
+    {
         if (isset($_POST['stid']) && isset($_POST['proname'])) {
             $this->contractact->updateStName($_POST['stid'], $_POST['proname']);
             return Doo::conf()->APP_URL . 'project/' . $this->params['pid'] . '/section';
@@ -279,7 +297,7 @@ class ProjectController extends DooController {
                 } else {
                     $statusStr = '';
                 }
-                $bdhtmlstr .='
+                $bdhtmlstr .= '
 				<tr>
 					<td><a href="/project/' . $this->params['pid'] . '/section/' . $value['pmid'] . '/detail">' . $value['pmname'] . '</a></td>
 					<td class="">第 ' . $numCount['numpname'] . ' 期' . $statusStr . '</td>
@@ -332,7 +350,8 @@ class ProjectController extends DooController {
         $this->render('w-project-section', $this->data, TRUE);
     }
 
-    Function fNumber($number) {
+    Function fNumber($number)
+    {
         if ($number == '')
             Return "-";
         $nlen = strlen($number);
@@ -348,7 +367,8 @@ class ProjectController extends DooController {
         Return $fNumber;
     }
 
-    private function getFav() {
+    private function getFav()
+    {
         $proArray = $this->project->getAll($this->auth->getUid());
         $this->data['othrPro'] = [];
         foreach ($proArray as $key => $value) {
@@ -361,7 +381,8 @@ class ProjectController extends DooController {
         }
     }
 
-    public function proSectionMeasure() {
+    public function proSectionMeasure()
+    {
 //此处未做更改,JSON文件已经固定名称
         $jsonpath = pathinfo($this->attfile->getMaxRow()['filepath']);
         if (isset($jsonpath['dirname'])) {
@@ -376,7 +397,7 @@ class ProjectController extends DooController {
                 closedir($handle);
             }
             $this->data['proArray'] = $proArray['Bills'];
-        }else {
+        } else {
             $this->data['proArray'] = [];
         }
         $this->data['mpid'] = $this->params['mpid'];
@@ -384,7 +405,8 @@ class ProjectController extends DooController {
         $this->render('w-project-section-measure', $this->data, TRUE);
     }
 
-    public function substr_replace_cn($string, $repalce = '*', $start = 0, $len = 0) {
+    public function substr_replace_cn($string, $repalce = '*', $start = 0, $len = 0)
+    {
         $count = mb_strlen($string, 'UTF-8'); //此处传入编码,建议使用utf-8。此处编码要与下面mb_substr()所使用的一致
         if (!$count) {
             return $string;
@@ -403,12 +425,13 @@ class ProjectController extends DooController {
             } else {
                 $returnString .= $tmpString;
             }
-            $i ++;
+            $i++;
         }
         return $returnString;
     }
 
-    function unicode_encode($name) {//to Unicode
+    function unicode_encode($name)
+    {//to Unicode
         $name = iconv('UTF-8', 'UCS-2', $name);
         $len = strlen($name);
         $str = '';
@@ -425,7 +448,8 @@ class ProjectController extends DooController {
         return $str;
     }
 
-    function unicode_decode($name) {//Unicode to
+    function unicode_decode($name)
+    {//Unicode to
         $pattern = '/([\w]+)|(\\\u([\w]{4}))/i';
         preg_match_all($pattern, $name, $matches);
         if (!empty($matches)) {
@@ -446,7 +470,8 @@ class ProjectController extends DooController {
         return $name;
     }
 
-    public function proDetail() {
+    public function proDetail()
+    {
 // 面包屑导航项目
         $this->data['currproArray'] = $this->data['allproArray'] = NULL;
         $this->data['pmid'] = $this->params['pmid'];
@@ -501,7 +526,8 @@ class ProjectController extends DooController {
         $this->render('w-project-section-detail', $this->data, TRUE);
     }
 
-    public function welcome() {
+    public function welcome()
+    {
 //	if (!$this->auth->isLoggedIn())
 //	    return Doo::conf()->APP_URL;
         if ($this->profile->getProWithUid($this->auth->getUid())['userid'])
@@ -515,7 +541,8 @@ class ProjectController extends DooController {
         $this->render('welcome', $this->data);
     }
 
-    public function prolist() {
+    public function prolist()
+    {
 //	if (!$this->auth->isLoggedIn())
 //	    return Doo::conf()->APP_URL;
 //	$proArray = new stdClass();
@@ -536,7 +563,8 @@ class ProjectController extends DooController {
     }
 
 // ajax提取密码名称
-    public function getAjaxSection() {
+    public function getAjaxSection()
+    {
         if (!$this->isAjax())
             return;
         echo json_encode($_POST);

+ 11 - 1
protected/controller/RProjectController.php

@@ -33,6 +33,16 @@ class RProjectController extends DooController
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 'r';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
+        $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
+        if (isset($mpidArray[0]['pid'])) {
+            foreach ($mpidArray as $key => $value) {
+                // 审批操作按照时间排序多标段
+                $this->data['numofchecking'] += $this->measureauditact->getCountMyChecking($value['pid'], $this->auth->getUid());
+            }
+        }
+        if ($this->data['numofchecking'] == 0) {
+            $this->data['numofchecking'] = null;
+        }
     }
 
     public function beforeRun($resource, $action)
@@ -53,7 +63,7 @@ class RProjectController extends DooController
 
     public function index()
     {
-        $mpidArray = $this->measureauditact->getAuditProject($this->auth->getUid());
+        $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
         if (isset($mpidArray[0]['pid'])) {
             foreach ($mpidArray as $key => $value) {
                 // 审批操作按照时间排序多标段

+ 10 - 0
protected/controller/SProjectController.php

@@ -46,6 +46,16 @@ class SProjectController extends DooController {
         $this->data['rootUrl'] = Doo::conf()->APP_URL;
         $this->data['currChannle'] = 's';
         $this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
+        $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
+        if (isset($mpidArray[0]['pid'])) {
+            foreach ($mpidArray as $key => $value) {
+                // 审批操作按照时间排序多标段
+                $this->data['numofchecking'] += $this->measureauditact->getCountMyChecking($value['pid'], $this->auth->getUid());
+            }
+        }
+        if ($this->data['numofchecking'] == 0) {
+            $this->data['numofchecking'] = null;
+        }
     }
 
     public function index() {

+ 1 - 1
protected/view/left.html

@@ -2,7 +2,7 @@
     <div class="mainNav">
 	<ul>
 	    <li data-placement="right" data-toggle="tooltip" data-original-title="业主"><a href="{{rootUrl}}project/index" <!-- if {{currChannle}}=='p' --> class="focus" <!-- endif --> title="项目管理"><div data-icon="A" aria-hidden="true" class="navIcon"></div>项目管理</a></li>
-	    <li data-placement="right" data-toggle="tooltip" data-original-title="审批人"><a href="{{rootUrl}}rproject/index" <!-- if {{currChannle}}=='r' --> class="focus" <!-- endif --> title="需审批项目"><div data-icon="C" aria-hidden="true" class="navIcon"></div>审批项目</a><span class="badge badge-warning"></span></li>
+	    <li data-placement="right" data-toggle="tooltip" data-original-title="审批人"><a href="{{rootUrl}}rproject/index" <!-- if {{currChannle}}=='r' --> class="focus" <!-- endif --> title="需审批项目"><div data-icon="C" aria-hidden="true" class="navIcon"></div>审批项目</a><span class="badge badge-warning">{{numofchecking}}</span></li>
 	    <li data-placement="right" data-toggle="tooltip" data-original-title="计量上报人"><a href="{{rootUrl}}sproject/index" <!-- if {{currChannle}}=='s' --> class="focus" <!-- endif --> title="我编制的项目"><div data-icon="B" aria-hidden="true" class="navIcon"></div>编制项目</a></li>
 	    <!--<li><a href="" title="生成报表"><div data-icon="D" aria-hidden="true" class="navIcon"></div>报表</a></li>-->
 	    <!--<li><a href="" title="数据汇总"><div data-icon="E" aria-hidden="true" class="navIcon"></div>汇总</a></li>-->

+ 1 - 1
protected/view/r-project.html

@@ -46,7 +46,7 @@
 					<div class="bar bar-success" style="width: {{proArray' value.pcurrdone}};">{{proArray' value.pcurrdone}}</div>
 				    </div>
 				</div>
-				<div class="detail2 fR"><p style="margin:0 0 5px 0" class="colOrange">有 <b>{{proArray' value.numofchecking}}</b> 个标段需要审批</p></div>
+				<!-- if {{proArray' value.numofchecking}} > 0 --><div class="detail2 fR"><p style="margin:0 0 5px 0" class="colOrange">有 <b>{{proArray' value.numofchecking}}</b> 个标段需要审批</p></div><!-- endif -->
 			    </div>
 			</div>
 			<!-- endloop -->