浏览代码

Merge branch 'feature/计量支付在线审批' into develop

# Conflicts:
#	protected/config/ver.conf.php
NoNZero 9 年之前
父节点
当前提交
a1369da625

文件差异内容过多而无法显示
+ 913 - 756
global/css/style.css


+ 84 - 42
protected/class/attfile.php

@@ -2,95 +2,137 @@
 
 Doo::loadModel('fileup');
 
-class attFile {
+class attFile
+{
 
     private $__file;
 
-    function __construct() {
-	$this->__file = new fileup();
+    function __construct()
+    {
+        $this->__file = new fileup();
     }
 
-    public function insertFile($pid, $stid, $mpid, $pmid, $numpname, $auditoruid, $filepath, $ziphashcode = 0, $filehashcode = 0, $times = 0) {
-	return $this->__file->createFile($pid, $stid, $mpid, $pmid, $numpname, $auditoruid, $filepath, $ziphashcode = 0, $filehashcode, 2, $times);
+    public function insertFile($pid, $stid, $mpid, $pmid, $numpname, $auditoruid, $filepath, $ziphashcode = 0, $filehashcode = 0, $times = 0)
+    {
+        return $this->__file->createFile($pid, $stid, $mpid, $pmid, $numpname, $auditoruid, $filepath, $ziphashcode = 0, $filehashcode, 2, $times);
     }
 
-    public function getMaxRow() {
-	return $this->__file->getOne(array('where' => 'aid = (select max(aid)) order by aid desc', 'asArray' => TRUE));
+    public function getMaxRow()
+    {
+        return $this->__file->getOne(array('where' => 'aid = (select max(aid)) order by aid desc', 'asArray' => TRUE));
     }
 
-    public function getDownUrl($mpid) {
-	return $this->__file->getOne(array('where' => 'mpid=?', 'param' => array($mpid), 'asArray' => TRUE));
+    public function getDownUrl($mpid)
+    {
+        return $this->__file->getOne(array('where' => 'mpid=?', 'param' => array($mpid), 'asArray' => TRUE));
     }
 
-    public function getNewLast($pmid, $numpname, $times = 0) {
-	return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=?  and isnew=2', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
+    public function getNewLast($pmid, $numpname, $times = 0)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=?  and isnew=2', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
     }
 
-    public function getNewLast3($pmid, $numpname, $times = 0) {
-	return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=?  and isnew=2', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
+    public function getNewLast3($pmid, $numpname, $times = 0)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=?  and isnew=2', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
     }
 
-    public function getMeasureLastNew($pmid, $numpname) {
-	return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and isnew=2', 'param' => array($pmid, $numpname), 'desc' => 'times', 'asArray' => TRUE));
+    public function getMeasureLastNew($pmid, $numpname)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and isnew=2', 'param' => array($pmid, $numpname), 'desc' => 'times', 'asArray' => TRUE));
     }
 
-    public function getNewLast2($pmid, $numpname) {
-	return $this->__file->getOne(array('where' => 'stid=? and isnew=2', 'param' => array($pmid, $numpname), 'groupby' => 'numpname', 'asArray' => TRUE));
+    public function getNewLast2($pmid, $numpname)
+    {
+        return $this->__file->getOne(array('where' => 'stid=? and isnew=2', 'param' => array($pmid, $numpname), 'groupby' => 'numpname', 'asArray' => TRUE));
     }
 
-    public function getFirstFile($pmid, $numpname, $times = 0) {
-	return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=?  and isnew=1', 'orderby' => 'aid', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
+    public function getFirstFile($pmid, $numpname, $times = 0)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=?  and isnew=1', 'orderby' => 'aid', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
     }
 
-    public function getLastData($stid) {
-	return $this->__file->find(array('where' => 'stid=? and isnew=2', 'param' => array($stid), 'groupby' => 'pmid', 'asArray' => TRUE));
+    public function getLastData($stid)
+    {
+        return $this->__file->find(array('where' => 'stid=? and isnew=2', 'param' => array($stid), 'groupby' => 'pmid', 'asArray' => TRUE));
     }
 
-    public function getFileUpdate($pmid) {
-	return $this->__file->getOne(array('where' => 'aid=(SELECT max(aid) FROM jl_attachment where pmid=? and isnew=2)', 'desc' => 'aid', 'param' => array($pmid), 'asArray' => TRUE));
+    public function getFileUpdate($pmid)
+    {
+        return $this->__file->getOne(array('where' => 'aid=(SELECT max(aid) FROM jl_attachment where pmid=? and isnew=2)', 'desc' => 'aid', 'param' => array($pmid), 'asArray' => TRUE));
 //	return $this->__file->getOne(array('where' => 'numpname=(SELECT max(numpname) FROM jl_attachment pmid=?) and isnew=2', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getLastNewProfile($pmid) {
-	return $this->__file->getOne(array('where' => 'pmid=? and isnew=2', 'groupby' => 'numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
+    public function getLastNewProfile($pmid)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and isnew=2', 'groupby' => 'numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getLastNewProfile2($pmid) {
-	return $this->__file->getOne(array('where' => 'pmid=? and isnew=2', 'groupby' => 'pmid,numpname,times', 'desc' => 'aid', 'param' => array($pmid), 'asArray' => TRUE));
+    public function getLastNewProfile2($pmid)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and isnew=2', 'groupby' => 'pmid,numpname,times', 'desc' => 'aid', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
-    public function getLastNewProfileUnlock($pmid, $numpname, $times) {
-	return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=? and isnew=1', 'groupby' => 'numpname', 'desc' => 'times', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
+    public function getLastNewProfileUnlock($pmid, $numpname, $times)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=? and isnew=1', 'groupby' => 'numpname', 'desc' => 'times', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
+    }
+
+    public function getLastNewProfileUnlock2($pmid, $numpname)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and isnew=2', 'desc' => 'times', 'param' => array($pmid, $numpname), 'asArray' => TRUE));
+    }
+
+    public function getLastNewProfileUnlock3($pmid, $numpname, $times)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=? and isnew=1', 'desc' => 'times', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
+    }
+
+    public function getReportFile($pmid, $numpname, $times)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and numpname=? and times=?', 'asc' => 'aid', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
     }
 
 // for api
-    public function getAllRowPid($pid) {
-	return $this->__file->find(array('where' => 'pid=? and isnew=2', 'groupby' => 'pmid,numpname', 'desc' => 'times', 'param' => array($pid), 'asArray' => TRUE));
+    public function getAllRowPid($pid)
+    {
+        return $this->__file->find(array('where' => 'pid=? and isnew=2', 'groupby' => 'pmid,numpname', 'desc' => 'times', 'param' => array($pid), 'asArray' => TRUE));
     }
 
     //  for API 根据PID分组pmid
-    public function getPmidGroup($pid) {
-	return $this->__file->find(array('where' => 'pid=? and isnew=2', 'groupby' => 'pmid', 'param' => array($pid), 'asArray' => TRUE));
+    public function getPmidGroup($pid)
+    {
+        return $this->__file->find(array('where' => 'pid=? and isnew=2', 'groupby' => 'pmid', 'param' => array($pid), 'asArray' => TRUE));
     }
 
     // for API 根据pmid,审核人id 获取最新一期最新一次记录
-    public function getLastNumTimes($pmid) {
-	return $this->__file->getOne(array('where' => 'pmid=? and isnew=2', 'desc' => 'aid', 'param' => array($pmid), 'asArray' => TRUE));
+    public function getLastNumTimes($pmid)
+    {
+        return $this->__file->getOne(array('where' => 'pmid=? and isnew=2', 'desc' => 'aid', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
     // 去重复
-    public function getMaxTimes($bid, $num) {
-	return $this->__file->getOne(array('select' => 'max(times) as maxtimes', 'where' => 'pmid=? and numpname=?', 'param' => array($bid, $num), 'asArray' => TRUE));
+    public function getMaxTimes($bid, $num)
+    {
+        return $this->__file->getOne(array('select' => 'max(times) as maxtimes', 'where' => 'pmid=? and numpname=?', 'param' => array($bid, $num), 'asArray' => TRUE));
     }
 
     // 去重复
-    public function getMaxTimes2($bid, $num) {
-	return $this->__file->getOne(array('select' => 'max(times) as maxtimes', 'where' => 'pmid=? and numpname=?', 'groupby' => 'pmid,numpname', 'param' => array($bid, $num), 'asArray' => TRUE));
+    public function getMaxTimes2($bid, $num)
+    {
+        return $this->__file->getOne(array('select' => 'max(times) as maxtimes', 'where' => 'pmid=? and numpname=?', 'groupby' => 'pmid,numpname', 'param' => array($bid, $num), 'asArray' => TRUE));
+    }
+
+    public function setOldfileFlag($pmid, $numpname, $times = 0)
+    {
+        $this->__file->isnew = 1;
+        return $this->__file->update(array('where' => 'pmid=? and numpname=? and times=?', 'param' => array($pmid, $numpname, $times)));
     }
 
-    public function setOldfileFlag($pmid, $numpname, $times = 0) {
-	$this->__file->isnew = 1;
-	return $this->__file->update(array('where' => 'pmid=? and numpname=? and times=?', 'param' => array($pmid, $numpname, $times)));
+    public function updateHash($pmid, $numpname, $times = 0)
+    {
+        $this->__file->filehashcode = md5(mt_rand());
+        return $this->__file->update(array('where' => 'pmid=? and numpname=? and times=? and isnew=2', 'param' => array($pmid, $numpname, $times)));
     }
 
 }

+ 127 - 110
protected/class/auth.php

@@ -9,140 +9,157 @@ Doo::loadModelAt('ausers', 'admin');
 Doo::loadClass('user');
 Doo::loadModel('uprofile');
 
-class Auth {
+class Auth
+{
 
     private $users, $usession, $user, $uinfo, $ausers, $profile;
 
-    public function __construct() {
-	$this->users = new Users();
-	$this->usession = new Usession();
-	$this->user = new User();
-	$this->ausers = new AUsers();
-	$this->profile = new Uprofile();
+    public function __construct()
+    {
+        $this->users = new Users();
+        $this->usession = new Usession();
+        $this->user = new User();
+        $this->ausers = new AUsers();
+        $this->profile = new Uprofile();
     }
 
-    private function __setcookie($key, $value) {
-	setcookie($this->cookiePre . $key, $value, 0, '/', $this->siteUrl, 0);
+    private function __setcookie($key, $value)
+    {
+        setcookie($this->cookiePre . $key, $value, 0, '/', $this->siteUrl, 0);
     }
 
-    public function login($uname, $upasswd) {
-	$uinfo = $this->checkLogin($uname, $upasswd);
-	if (isset($uinfo['uid'])) {
-	    $this->uinfo = $uinfo;
-	    return TRUE;
-	} else {
-	    return FALSE;
-	}
+    public function login($uname, $upasswd)
+    {
+        $uinfo = $this->checkLogin($uname, $upasswd);
+        if (isset($uinfo['uid'])) {
+            $this->uinfo = $uinfo;
+            return TRUE;
+        } else {
+            return FALSE;
+        }
     }
 
-    public function getUinfo() {
-	return $this->uinfo;
+    public function getUinfo()
+    {
+        return $this->uinfo;
     }
 
-    public function getUid() {
-	if (isset($_SESSION['uid']) && $_SESSION['uid']) {
-	    return $_SESSION['uid'];
-	} else {
-	    return FALSE;
-	}
+    public function getUid()
+    {
+        if (isset($_SESSION['uid']) && $_SESSION['uid']) {
+            return $_SESSION['uid'];
+        } else {
+            return FALSE;
+        }
     }
 
-    public function getUemail() {
-	if (isset($_SESSION['uemail']) && $_SESSION['uemail']) {
-	    return $_SESSION['uemail'];
-	} else {
-	    return 0;
-	}
+    public function getUemail()
+    {
+        if (isset($_SESSION['uemail']) && $_SESSION['uemail']) {
+            return $_SESSION['uemail'];
+        } else {
+            return 0;
+        }
     }
 
-    public function setUid($uid) {
-	return $_SESSION['uid'] = $uid;
+    public function setUid($uid)
+    {
+        return $_SESSION['uid'] = $uid;
     }
 
-    public function setUemail($uemail) {
-	return $_SESSION['uemail'] = $uemail;
+    public function setUemail($uemail)
+    {
+        return $_SESSION['uemail'] = $uemail;
     }
 
-    public function getAvatar($uid) {
+    public function getAvatar($uid)
+    {
 //	$dir1 = ceil($uid / 10000);
 //	$dir2 = ceil($uid % 10000 / 1000);
 //	$url = 'http://sso.smartcost.com.cn/' . 'data/avatar/' . $dir1 . '/' . $dir2 . '/' . $uid . '/';
 //	$avatar = array('180' => $url . '180x180.jpg', '90' => $url . '90x90.jpg', '45' => $url . '45x45.jpg', '30' => $url . '30x30.jpg');
 //	return $avatar;
-	$valArray = $this->profile->getOne(array('where' => 'userid=?', 'param' => array($uid), 'asArray' => TRUE));
-	return Doo::conf()->APP_URL . $valArray['avatar'];
-    }
-
-    public function checkLogin($uemail, $upasswd) {
-	return $this->user->login($uemail, $upasswd);
-    }
-
-    public function logout() {
-	session_destroy();
-	setcookie('token', '-1', 0, '/', 'jl.local', FALSE, TRUE);
-    }
-
-    public function checkauth() {
-	//TODO 启用SESSION变量避免重复查询数据库
-	if (isset($_COOKIE['M0s5Yi_yn_k']) && isset($_COOKIE['M0s5Yi_yn_v'])) {
-	    $uname = $this->decryptCookie($_COOKIE['M0s5Yi_yn_k']);
-	    $passwd = $this->decryptCookie($_COOKIE['M0s5Yi_yn_v']);
-	    if ($uname && $passwd) {
-		return TRUE;
-	    } else {
-		return FALSE;
-	    }
-	} else {
-	    return FALSE;
-	}
-    }
-
-    function isLoggedIn() {
-	if (isset($_SESSION['token']) && isset($_COOKIE['token'])) {
-	    if ($_SESSION['token'] != $_COOKIE['token']) {
-		return TRUE;
-	    }
-	}
-	return FALSE;
-    }
-
-    public function getUname() {
-	//TODO 启用SESSION变量避免重复查询数据库
-	if (isset($_COOKIE['M0s5Yi_yn_k']) && isset($_COOKIE['M0s5Yi_yn_v'])) {
-	    $uname = $this->decryptCookie($_COOKIE['M0s5Yi_yn_k']);
-	    $passwd = $this->decryptCookie($_COOKIE['M0s5Yi_yn_v']);
-	    if ($uname && $passwd) {
-		return $uname;
-	    } else {
-		return FALSE;
-	    }
-	} else {
-	    return FALSE;
-	}
-    }
-
-    private function encryptCookie($value) {
-	if (!$value) {
-	    return false;
-	}
-	$key = '290234lk23jk23djLHSWCs92s';
-	$text = $value;
-	$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
-	$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
-	$crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
-	return trim(base64_encode($crypttext)); //encode for cookie
-    }
-
-    private function decryptCookie($value) {
-	if (!$value) {
-	    return false;
-	}
-	$key = '290234lk23jk23djLHSWCs92s';
-	$crypttext = base64_decode($value); //decode cookie
-	$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
-	$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
-	$decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv);
-	return trim($decrypttext);
+        $valArray = $this->profile->getOne(array('where' => 'userid=?', 'param' => array($uid), 'asArray' => TRUE));
+        return Doo::conf()->APP_URL . $valArray['avatar'];
+    }
+
+    public function checkLogin($uemail, $upasswd)
+    {
+        return $this->user->login($uemail, $upasswd);
+    }
+
+    public function logout()
+    {
+        session_destroy();
+        setcookie('token', '-1', 0, '/', 'jl.local', FALSE, TRUE);
+    }
+
+    public function checkauth()
+    {
+        //TODO 启用SESSION变量避免重复查询数据库
+        if (isset($_COOKIE['M0s5Yi_yn_k']) && isset($_COOKIE['M0s5Yi_yn_v'])) {
+            $uname = $this->decryptCookie($_COOKIE['M0s5Yi_yn_k']);
+            $passwd = $this->decryptCookie($_COOKIE['M0s5Yi_yn_v']);
+            if ($uname && $passwd) {
+                return TRUE;
+            } else {
+                return FALSE;
+            }
+        } else {
+            return FALSE;
+        }
+    }
+
+    function isLoggedIn()
+    {
+        if (isset($_SESSION['token']) && isset($_COOKIE['token'])) {
+            if ($_SESSION['token'] != $_COOKIE['token']) {
+                return TRUE;
+            }
+        }
+        return FALSE;
+    }
+
+    public function getUname()
+    {
+        //TODO 启用SESSION变量避免重复查询数据库
+        if (isset($_COOKIE['M0s5Yi_yn_k']) && isset($_COOKIE['M0s5Yi_yn_v'])) {
+            $uname = $this->decryptCookie($_COOKIE['M0s5Yi_yn_k']);
+            $passwd = $this->decryptCookie($_COOKIE['M0s5Yi_yn_v']);
+            if ($uname && $passwd) {
+                return $uname;
+            } else {
+                return FALSE;
+            }
+        } else {
+            return FALSE;
+        }
+    }
+
+    private function encryptCookie($value)
+    {
+        if (!$value) {
+            return false;
+        }
+        $key = '290234lk23jk23djLHSWCs92s';
+        $text = $value;
+        $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
+        $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+        $crypttext = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $text, MCRYPT_MODE_ECB, $iv);
+        return trim(base64_encode($crypttext)); //encode for cookie
+    }
+
+    private function decryptCookie($value)
+    {
+        if (!$value) {
+            return false;
+        }
+        $key = '290234lk23jk23djLHSWCs92s';
+        $crypttext = base64_decode($value); //decode cookie
+        $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
+        $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
+        $decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv);
+        return trim($decrypttext);
     }
 
 }

+ 156 - 50
protected/class/measureauditact.php

@@ -7,15 +7,18 @@ Doo::loadModel('measureaudit');
  *
  * @author zongheng
  */
-class MeasureauditAct {
+class MeasureauditAct
+{
 
     private $__measureaudit;
 
-    function __construct() {
+    function __construct()
+    {
         $this->__measureaudit = new MeasureAudit();
     }
 
-    public function insertMeasureAudit($pid, $creatoruid, $auditoruid, $mpid, $pmid, $stid, $numpname, $status = 'uncheck', $last = 2, $times = 0) {
+    public function insertMeasureAudit($pid, $creatoruid, $auditoruid, $mpid, $pmid, $stid, $numpname, $status = 'uncheck', $last = 2, $times = 0)
+    {
         if (!isset($pid))
             return FALSE;
         $this->__measureaudit->pid = filter_var($pid, FILTER_VALIDATE_INT);
@@ -33,196 +36,281 @@ class MeasureauditAct {
         return $this->__measureaudit->insert();
     }
 
-    public function getUncheckRow($uid, $status) {
+    public function getUncheckRow($uid, $status)
+    {
         return $this->__measureaudit->find(array('where' => 'auditoruid=? and mastatus=?', 'param' => array($uid, $status), 'asArray' => TRUE));
     }
 
-    public function getAllRow($uid) {
+    public function getAllRow($uid)
+    {
         return $this->__measureaudit->find(array('where' => 'auditoruid=?', 'param' => array($uid), 'asArray' => TRUE));
     }
 
-    public function getAuditProject($uid) {
+    public function getAuditProject($uid)
+    {
         return $this->__measureaudit->find(array('where' => 'auditoruid=? and last=2', 'groupby' => 'pid', 'param' => array($uid), 'asArray' => TRUE));
     }
 
-    public function getProject($uid) {
+    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));
     }
 
-    public function getUncheckMaxMpid($uid, $pid, $status) {
+    public function getUncheckMaxMpid($uid, $pid, $status)
+    {
         return $this->__measureaudit->getOne(array('select' => 'max(mpid) as mpid', 'where' => 'auditoruid=? and pid=? and mastatus=?', 'param' => array($uid, $pid, $status), 'asArray' => TRUE));
     }
 
-    public function setStatusTrue($mpid) {
+    public function setStatusTrue($mpid)
+    {
         $this->__measureaudit->mastatus = 'checked';
         return $this->__measureaudit->update(array('where' => 'mpid=?', 'param' => array($mpid)));
     }
 
-    public function setStatusFalse($mpid) {
+    public function setStatusFalse($mpid)
+    {
         $this->__measureaudit->mastatus = 'checkno';
         return $this->__measureaudit->update(array('where' => 'mpid=?', 'param' => array($mpid)));
     }
 
-    public function getStatusByMpid($mpid) {
+    public function getStatusByMpid($mpid)
+    {
         return $this->__measureaudit->getOne(array('select' => 'mastatus', 'where' => 'mpid=?', 'param' => array($mpid), 'asArray' => TRUE));
     }
 
-    public function getRowByMpid($mpid) {
+    public function getRowByMpid($mpid)
+    {
         return $this->__measureaudit->find(array('where' => 'mpid=?', 'param' => array($mpid), 'asArray' => TRUE));
     }
 
+    public function getRowByMpid2($mpid)
+    {
+        return $this->__measureaudit->find(array('where' => 'mpid=? order by last desc,maid asc', 'param' => array($mpid), 'asArray' => TRUE));
+    }
+
+    public function getRowByMpidTimes($mpid,$times)
+    {
+        return $this->__measureaudit->find(array('where' => 'mpid=? and times=? order by last desc,maid asc', 'param' => array($mpid,$times), 'asArray' => TRUE));
+    }
+
+    public function getRowGroupByTimes($mpid)
+    {
+        return $this->__measureaudit->getOne(array('where' => 'mpid=?', 'groupby' => 'times', 'desc' => 'maid', 'param' => array($mpid), 'asArray' => TRUE));
+    }
+
 // for api
-    public function getAlluserMeasureAudit($bid, $num) {
+    public function getAlluserMeasureAudit($bid, $num)
+    {
         $maxtimesArray = $this->getMaxTimes($bid, $num);
         return $this->__measureaudit->find(array('where' => 'pmid=? and numpname=? and times=? order by last desc,maid asc', 'param' => array($bid, $num, $maxtimesArray['maxtimes']), 'asArray' => TRUE));
     }
 
 // for api
-    public function getAllAudit($bid, $num, $times) {
+    public function getAllAudit($bid, $num, $times)
+    {
         return $this->__measureaudit->find(array('where' => 'pmid=? and numpname=? and times=? order by last desc,maid asc', 'param' => array($bid, $num, $times), 'asArray' => TRUE));
     }
 
-    public function getUserAudit($bid, $num, $times = 0) {
+    public function getUserAudit($bid, $num, $times = 0)
+    {
         return $this->__measureaudit->find(array('where' => 'pmid=? and numpname=? and times=? order by maid asc', 'param' => array($bid, $num, $times), 'asArray' => TRUE));
     }
 
-    public function getUserAuditLast($bid, $num) {
+    public function getUserAuditLast($bid, $num)
+    {
         $maxtimesArray = $this->getMaxTimes($bid, $num);
         return $this->__measureaudit->find(array('where' => 'pmid=? and numpname=? and times=? order by maid asc', 'param' => array($bid, $num, $maxtimesArray['maxtimes']), 'asArray' => TRUE));
     }
 
-    public function getRowbyUID($audituid) {
+    public function getRowbyUID($audituid)
+    {
         return $this->__measureaudit->find(array('where' => 'auditoruid=?', 'param' => array($audituid), 'asArray' => TRUE));
     }
 
-    public function getCheckedRowbyUID($audituid) {
+    public function getCheckedRowbyUID($audituid)
+    {
         return $this->__measureaudit->find(array('where' => 'auditoruid=? and ((mastatus=\'uncheck\' or mastatus=\'checking\') or (mastatus=\'checked\' and DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= audittime))', 'param' => array($audituid), 'asArray' => TRUE));
     }
 
-    public function getCheckedRowbyUID2($audituid) {
+    public function getCheckedRowbyUID2($audituid)
+    {
         return $this->__measureaudit->find(array('where' => '(mastatus=\'checking\') and auditoruid=?', 'groupby' => 'pmid,numpname', 'param' => array($audituid), 'asArray' => TRUE));
     }
 
-    public function getMyRecord($audituid) {
+    public function getMyRecord($audituid)
+    {
         Doo::db()->connect();
         $reArray = Doo::db()->fetchAll('select a.* from jl_measure_audit a inner join (select pmid ,numpname, max(times) times from jl_measure_audit group by pmid,numpname) b on a.pmid = b.pmid and a.numpname = b.numpname and a.times = b.times   and (mastatus=\'uncheck\' or mastatus=\'checking\') and auditoruid=? order by a.pmid', array($audituid));
         Doo::db()->disconnect();
         return $reArray;
     }
 
-    public function getMyRecord2($audituid) {
+    public function getMyRecord2($audituid)
+    {
         $resArray = Doo::db()->fetchAll('select a.* from jl_measure_audit a inner join (select pmid ,numpname, max(times) times from jl_measure_audit group by pmid,numpname) b on a.pmid = b.pmid and a.numpname = b.numpname and a.times = b.times  and auditoruid=? order by a.pmid', array($audituid));
         Doo::db()->disconnect();
         return $resArray;
     }
 
-    public function getMyAllRecord($audituid) {
+    public function getMyAllRecord($audituid)
+    {
         return Doo::db()->query('select a.* from jl_measure_audit a inner join (select pmid ,numpname, max(times) times from jl_measure_audit group by pmid,numpname) b on a.pmid = b.pmid and a.numpname = b.numpname and a.times = b.times   and auditoruid=? order by a.pmid', array($audituid));
     }
 
-    public function getUpUIDStatus($pmid, $numpname, $creatoruid) {
+    public function getUpUIDStatus($pmid, $numpname, $creatoruid)
+    {
         return $this->__measureaudit->getOne(array('where' => 'pmid=? AND numpname=? AND auditoruid=?', 'param' => array($pmid, $numpname, $creatoruid), 'asArray' => TRUE));
     }
 
-    public function getFirstAuditor($pmid, $numpname, $times = 0) {
+    public function getMyAuditStatus($pmid, $numpname, $times, $uid)
+    {
+        return $this->__measureaudit->getOne(array('where' => 'pmid=? AND numpname=? AND times=? AND auditoruid=?', 'param' => array($pmid, $numpname, $times, $uid), 'asArray' => TRUE));
+    }
+
+    public function getMyAuditStatus2($pmid, $numpname, $times, $uid)
+    {
+        return $this->__measureaudit->getOne(array('where' => 'pmid=? AND numpname=? AND times=? AND auditoruid=?', 'param' => array($pmid, $numpname, $times, $uid), 'asc' => 'maid', 'asArray' => TRUE));
+    }
+
+
+    public function getFirstAuditor($pmid, $numpname, $times = 0)
+    {
         return $this->__measureaudit->getOne(array('where' => 'maid =(select min(maid) from jl_measure_audit where `pmid`=? and `numpname` =? and times=? and last=2)', 'param' => array($pmid, $numpname, $times), 'asArray' => TRUE));
     }
 
-    public function updateMastatus($maid) {
+    public function updateMastatus($maid)
+    {
         $this->__measureaudit->mastatus = 'checking';
-        $this->__measureaudit->auditcontent = '';
-        $this->__measureaudit->audittime = '';
+//        $this->__measureaudit->auditcontent = '';
+//        $this->__measureaudit->audittime = '';
         return $this->__measureaudit->update(array('where' => 'maid=?', 'param' => array($maid)));
     }
 
     // for api
-    public function updateAuditorMPID($mpid, $tenderid, $phaseno, $times = 0) {
+    public function updateAuditorMPID($mpid, $tenderid, $phaseno, $times = 0)
+    {
         $this->__measureaudit->mpid = $mpid;
         return $this->__measureaudit->update(array('where' => 'pmid=? and numpname=? and times=?', 'param' => array($tenderid, $phaseno, $times)));
     }
 
-    public function setCheckno($maid, $auditcontent = NULL) {
+    public function setCheckno($maid, $auditcontent = NULL, $isonline = 0)
+    {
         $this->__measureaudit->mastatus = 'checkno';
         $this->__measureaudit->audittime = time();
+        $this->__measureaudit->onlineaudit = $isonline;
         if (isset($auditcontent) && $auditcontent)
             $this->__measureaudit->auditcontent = $auditcontent;
         return $this->__measureaudit->update(array('where' => 'maid=?', 'param' => array($maid)));
     }
 
-    public function setStatusTo($maid, $status = 3, $auditcontent = '') {
+    public function setStatusTo($maid, $status = 3, $auditcontent = null, $isonline = 0)
+    {
+        $ma1 = new MeasureAudit();
         if ($status == 3) {
-            $this->__measureaudit->mastatus = 'checked';
+            $ma1->mastatus = 'checked';
         }
         if ($status == 4) {
-            $this->__measureaudit->mastatus = 'checkno';
+            $ma1->mastatus = 'checkno';
         }
         if (isset($auditcontent) && $auditcontent) {
-            $this->__measureaudit->auditcontent = $auditcontent;
+            $ma1->auditcontent = $auditcontent;
         }
-        $this->__measureaudit->audittime = time();
-        return $this->__measureaudit->update(array('where' => 'maid=?', 'param' => array($maid)));
+        $ma1->audittime = gettimeofday()['sec'];
+        $ma1->onlineaudit = $isonline;
+        return $ma1->update(array('where' => 'maid=?', 'param' => array($maid)));
     }
 
-    public function getRowInfo($pmid, $numpname, $auditoruid) {
+    public function setMyAuditPass($maid, $auditcontent = null, $isonline = 0, $uid = 0)
+    {
+        $ma = new MeasureAudit();
+        $ma->mastatus = 'checked';
+        $ma->audittime = gettimeofday()['sec'];
+        if (isset($auditcontent) && $auditcontent) {
+            $ma->auditcontent = $auditcontent;
+        }
+        $ma->onlineaudit = $isonline;
+        return $ma->update(array('where' => 'maid=? and auditoruid=?', 'param' => array($maid, $uid)));
+    }
+
+    public function getRowInfo($pmid, $numpname, $auditoruid)
+    {
         return $this->__measureaudit->getOne(array('where' => 'pmid=? and numpname=? and auditoruid=?', 'desc' => 'times', 'param' => array($pmid, $numpname, $auditoruid), 'asArray' => TRUE));
     }
 
 // for api
-    public function getLastNewRowInfo($pmid, $numpname, $auditoruid) {
+    public function getLastNewRowInfo($pmid, $numpname, $auditoruid)
+    {
         $maxtimesArray = $this->getMaxTimes($pmid, $numpname);
         return $this->__measureaudit->getOne(array('where' => 'pmid=? and numpname=? and auditoruid=? and times=?', 'param' => array($pmid, $numpname, $auditoruid, $maxtimesArray['maxtimes']), 'asArray' => TRUE));
     }
 
-    public function getStatusTender($pmid, $numpname) {
+    public function getStatusTender($pmid, $numpname)
+    {
         return $this->__measureaudit->getOne(array('where' => 'pmid=? and numpname=? and last=1', 'param' => array($pmid, $numpname), 'asArray' => TRUE));
     }
 
-    public function getStatusTen($pmid, $numpname) {
+    public function getStatusTen($pmid, $numpname)
+    {
         return $this->__measureaudit->find(array('where' => 'pmid=? and numpname=?', 'param' => array($pmid, $numpname), 'asArray' => TRUE));
     }
 
-    public function getAuditUser($bid, $num) {
+    public function getAuditUser($bid, $num)
+    {
         return $this->__measureaudit->find(array('where' => 'pmid=? and numpname=? order by last desc,maid asc', 'param' => array($bid, $num), 'asArray' => TRUE));
     }
 
     // 去重复
-    public function getAuditUserRedo($bid, $num) {
+    public function getAuditUserRedo($bid, $num)
+    {
         $maxtimesArray = $this->getMaxTimes($bid, $num);
         return $this->__measureaudit->find(array('where' => 'pmid=? and numpname=? and times=? order by last desc,maid asc', 'param' => array($bid, $num, $maxtimesArray['maxtimes']), 'asArray' => TRUE));
     }
 
     // 去重复
-    public function getMaxTimes($bid, $num) {
+    public function getMaxTimes($bid, $num)
+    {
         return $this->__measureaudit->getOne(array('select' => 'max(times) as maxtimes', 'where' => 'pmid=? and numpname=?', 'param' => array($bid, $num), 'asArray' => TRUE));
     }
 
-    public function getMaxTimesInt($bid, $num) {
+    public function getMaxTimesInt($bid, $num)
+    {
         return $this->__measureaudit->getOne(array('select' => 'max(times) as maxtimes', 'where' => 'pmid=? and numpname=?', 'param' => array($bid, $num), 'asArray' => TRUE))['maxtimes'];
     }
 
-    public function delAuditUser($tenderid, $phaseno, $uid) {
+    public function delAuditUser($tenderid, $phaseno, $uid)
+    {
         return $this->__measureaudit->delete(array('where' => 'pmid=? and numpname=? and auditoruid=?', 'param' => array($tenderid, $phaseno, $uid), 'asArray' => TRUE));
     }
 
-    public function delAuditUserTimes($tenderid, $phaseno, $uid, $times = 0) {
+    public function delAuditUserTimes($tenderid, $phaseno, $uid, $times = 0)
+    {
         return $this->__measureaudit->delete(array('where' => 'pmid=? and numpname=? and auditoruid=? and times=?', 'param' => array($tenderid, $phaseno, $uid, $times), 'asArray' => TRUE));
     }
 
-    public function getCurrUserAllProject($audituid) {
+    public function getCurrUserAllProject($audituid)
+    {
         return $this->__measureaudit->find(array('where' => 'auditoruid=?', 'param' => array($audituid), 'desc' => 'numpname,times', 'groupby' => 'pmid', 'asArray' => TRUE));
     }
 
     // for API 获取用户参与PMID组
-    public function getPmidGroup($audituid) {
+    public function getPmidGroup($audituid)
+    {
         return $this->__measureaudit->find(array('where' => 'auditoruid=?', 'param' => array($audituid), 'groupby' => 'pmid', 'asArray' => TRUE));
     }
 
     // for API 根据pmid,审核人id 获取最新一期最新一次记录
-    public function getLastNumTimes($pmid, $audituid) {
+    public function getLastNumTimes($pmid, $audituid)
+    {
         return $this->__measureaudit->getOne(array('where' => 'auditoruid=? and pmid=?', 'desc' => 'maid', 'param' => array($audituid, $pmid), 'asArray' => TRUE));
     }
 
-    public function getUserPmid($audituid) {
+    public function getUserPmid($audituid)
+    {
         return $this->__measureaudit->find(array('select' => 'pmid', 'where' => 'auditoruid=?', 'param' => array($audituid), 'groupby' => 'pmid', 'asArray' => TRUE));
     }
 
@@ -233,9 +321,27 @@ class MeasureauditAct {
      * @return type
      *  最新一次的
      */
-    public function getAuditOpinion($tenderid, $phaseno) {
+    public function getAuditOpinion($tenderid, $phaseno)
+    {
         $maxtimesArray = $this->getMaxTimes($tenderid, $phaseno);
         return $this->__measureaudit->find(array('select' => 'auditoruid,auditcontent', 'where' => 'pmid=? and numpname=? and times=?', 'param' => array($tenderid, $phaseno, $maxtimesArray['maxtimes']), 'asArray' => TRUE));
     }
 
+    public function getMyChecking($pid, $auditoruid, $all = false)
+    {
+        if ($all) {
+            return $this->__measureaudit->find(array('where' => 'pid=? and auditoruid=? and mastatus=\'checking\'', 'param' => array($pid, $auditoruid), 'asArray' => TRUE));
+        } else {
+            return $this->__measureaudit->getOne(array('where' => 'pid=? and auditoruid=? and mastatus=\'checking\'', 'param' => array($pid, $auditoruid), 'asArray' => TRUE));
+        }
+
+    }
+
+    public function getCountMyChecking($pid, $auditoruid)
+    {
+
+        return $this->__measureaudit->count(array('where' => 'pid=? and auditoruid=? and mastatus=\'checking\'', 'param' => array($pid, $auditoruid)));
+
+    }
+
 }

+ 20 - 2
protected/class/numofperact.php

@@ -149,6 +149,10 @@ class NumofperAct {
         return $this->__numofperact->find(array('where' => 'pmid=? and currstatus!=\'checkno\'', 'groupby' => 'numpname', 'desc' => 'numpname,times', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
+    public function getGroupByLastOne2($pmid) {
+        return $this->__numofperact->find(array('where' => 'pmid=?', 'groupby' => 'numpname', 'desc' => 'numpname,times', 'param' => array($pmid), 'asArray' => TRUE));
+    }
+
     public function getRowByPmid2($pmid) {
         return $this->__numofperact->find(array('where' => 'pmid=?', 'param' => array($pmid), 'asArray' => TRUE));
     }
@@ -190,7 +194,7 @@ class NumofperAct {
     }
 
     public function getChecknoRow($pmid, $numpname) {
-        return $this->__numofperact->getOne(array('where' => 'pmid=? and numpname=?', 'orderby' => 'times', 'desc' => 'times', 'param' => array($pmid, $numpname), 'asArray' => TRUE));
+        return $this->__numofperact->getOne(array('where' => 'pmid=? and numpname=?', 'desc' => 'times', 'param' => array($pmid, $numpname), 'asArray' => TRUE));
     }
 
 //    public function getMaxCurrStatus($pid, $pmid, $stid) {
@@ -202,7 +206,15 @@ class NumofperAct {
     }
 
     public function getLastStatus2($pid, $pmid) {
-        return $this->__numofperact->getOne(array('where' => 'pid=? and pmid=?', 'groupby' => 'pmid,numpname', 'desc' => 'times', 'param' => array($pid, $pmid), 'asArray' => TRUE));
+        return $this->__numofperact->getOne(array('where' => 'pid=? and pmid=?', 'groupby' => 'pmid,numpname,times', 'desc' => 'times', 'param' => array($pid, $pmid), 'asArray' => TRUE));
+    }
+
+    public function getLastStatus3($pid, $pmid) {
+        return $this->__numofperact->getOne(array('where' => 'pid=? and pmid=?', 'desc' => 'numpname', 'param' => array($pid, $pmid), 'asArray' => TRUE));
+    }
+
+    public function getLastRow($pid, $pmid) {
+        return $this->__numofperact->getOne(array('where' => 'pid=? and pmid=?', 'groupby' => 'numpname,times', 'desc' => 'mpid', 'param' => array($pid, $pmid), 'asArray' => TRUE));
     }
 
     public function getChangTotal($pid) {
@@ -231,6 +243,12 @@ class NumofperAct {
 //	return $this->__numofperact->getOne(array('select' => 'stopnowtotal, currdone', 'where' => 'pmid = ? and currstatus!=\'checkno\'', 'orderby' => 'numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
     }
 
+    //标段下最新一期
+    public function getLastNew2($pmid) {
+        return $this->__numofperact->getOne(array('where' => 'pmid = ?', 'groupby' => 'pmid, numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
+//	return $this->__numofperact->getOne(array('select' => 'stopnowtotal, currdone', 'where' => 'pmid = ? and currstatus!=\'checkno\'', 'orderby' => 'numpname', 'desc' => 'numpname', 'param' => array($pmid), 'asArray' => TRUE));
+    }
+
     //更新数据
     public function updateNumofper($tenderid, $phaseno, $itemArray, $times = 0) {
         if (!is_array($itemArray)) {

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

@@ -21,6 +21,7 @@ $route['*']['/rproject/:pid/section'] = array('RProjectController', 'proSection'
 $route['*']['/rproject/:pid/section/:mpid/measure'] = array('RProjectController', 'proSectionMeasure');
 $route['*']['/rproject/:pid/section/:pmid/detail'] = array('RProjectController', 'proDetail');
 $route['*']['/rproject/:pmid/measure/detail'] = array('RProjectController', 'proMeasure');
+$route['*']['/rproject/:pid/section/:pmid/report/:mpid'] = array('RProjectController', 'proReport');
 // S
 $route['get']['/sproject/index'] = array('SProjectController', 'index');
 $route['get']['/sproject/:pid/section'] = array('SProjectController', 'proSection');
@@ -103,6 +104,10 @@ $route['*']['/api/client/user/set/:userid/:tenderid/:phaseno/checkno'] = array('
  */
 $route['*']['/api/client/user/create/:tenderid/:phaseno/new/audit'] = array('ClientController', 'createNewAudit');
 /**
+ * 重做新一期获取原报上报文件
+ */
+$route['*']['/api/client/user/get/:tenderid/:phaseno/report/file'] = array('ClientController', 'getReportFile');
+/**
  * 从桌面软件端变更标段名称接口
  */
 $route['*']['/api/client/tender/:BidID/:BidNewName/update'] = array('ClientController', 'updateTenderName');

文件差异内容过多而无法显示
+ 149 - 86
protected/controller/ClientController.php


+ 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);

+ 185 - 19
protected/controller/RProjectController.php

@@ -18,7 +18,7 @@ Doo::loadClass('numofperact');
 class RProjectController extends DooController
 {
 
-    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审核', 'checking' => '审核中', 'checked' => '已审核', 'checkno' => '未通过');
+    private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审批', 'checking' => '审批中', 'checked' => '已审批', 'checkno' => '未通过');
 
     public function __construct()
     {
@@ -33,6 +33,17 @@ 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'])) {
+            $this->data['numofchecking'] = 0;
+            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,10 +64,14 @@ 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) {
+                // 审批操作按照时间排序多标段
+                $numOfChecking = $this->measureauditact->getCountMyChecking($value['pid'], $this->auth->getUid());
+                // end
                 $this->data['proArray'][$key] = $this->project->getRowByPid($value['pid']);
+                $this->data['proArray'][$key]['numofchecking'] = $numOfChecking;
                 $this->data['proArray'][$key]['contracttotal'] = $this->actmeasure->getTotalWithPid($value['pid']);
                 $this->data['proArray'][$key]['changTotal'] = $this->numofperact->getChangTotal($value['pid']);
 //                $this->data['proArray'][$key]['contracttotal'] += $this->data['proArray'][$key]['changTotal'];
@@ -88,7 +103,11 @@ class RProjectController extends DooController
 
     public function proSection()
     {
-        $this->data['allproArray'] = $this->project->getAll();
+        $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
+        foreach ($mpidArray as $k1 => $v1) {
+            if ($v1['pid'] != $this->params['pid'])
+                $this->data['allproArray'][] = $this->project->getRowByPid($v1['pid']);
+        }
         $this->data['currproArray'] = $this->project->getRowByPid($this->params['pid']);
         $this->data['conArray'] = $this->contractact->getRowByPid($this->params['pid']);
         $auditArray = $this->measureauditact->getUserPmid($this->auth->getUid());
@@ -104,7 +123,7 @@ class RProjectController extends DooController
             $ncurrdone = number_format(0, 2, '.', ',');
             $pnowtotal = '0%';
             $dispcurrdone = '0%';
-            $numStatusArray['currstatus'] = 'uncheck';
+//            $numStatusArray['currstatus'] = 'uncheck';
             $StidArray = $this->actmeasure->getAllbyStid($value['stid']);
             $currdoneInt = $this->numofperact->getCurrdoneSTID($value['stid'])['totalplus'];
             if (isset($StidArray))
@@ -123,23 +142,32 @@ class RProjectController extends DooController
                         $dispstopnowtotal = $pstopnowtotal . '%';
                         $pnowtotal = 100 - $pcurrdone - $pstopnowtotal;
                         $dispnowtotal = $pnowtotal . '%';
-                        $countNum = $this->numofperact->getCountTotalnum($v['pmid']);
-                        $numStatusArray = $this->numofperact->getLastStatus($this->params['pid'], $v['pmid']);
+                        $countNum = $this->numofperact->getLastNew2($v['pmid'])['numpname'];
+                        if (!isset($countNum)) {
+                            $countNum = 0;
+                        }
+                        $numStatusArray = $this->numofperact->getLastStatus3($this->params['pid'], $v['pmid']);
                         if (!isset($numStatusArray['currstatus'])) {
                             $numStatusArray['currstatus'] = 'uncheck';
                         }
+                        $datatmp = $this->measureauditact->getMyAuditStatus2($numStatusArray['pmid'], $numStatusArray['numpname'], $numStatusArray['times'], $this->auth->getUid());
+                        if ($datatmp && ($datatmp['mastatus'] == 'checking')) {
+                            $buttonhtml = '<a class="btn btn-warning btn-small" href="/rproject/' . $this->params['pid'] . '/section/' . $v['pmid'] . '/report/' . $numStatusArray['mpid'] . '">开始审批</a>';
+                        } else {
+                            $buttonhtml = '(<span class="colOrange">' . $this->statusArray[$numStatusArray['currstatus']] . '</span>)';
+                        }
                         $html .= '<tr>
-		<td><a href="/rproject/' . $this->params['pid'] . '/section/' . $v['pmid'] . '/detail">' . $v['pmname'] . '</a></td>
-		<td class="">第 ' . $countNum . ' 期(<span class="colOrange">' . $this->statusArray[$numStatusArray['currstatus']] . '</span>)</td>
-		<td class="taR">¥' . number_format($v['contracttotal'], 2, '.', ',') . '</td>
-		<td>
-		    <div class="progress">
-			<div class="bar bar-success" style="width: ' . $dispstopnowtotal . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期完成:¥' . $nstopnowtotal . '">' . $dispstopnowtotal . '</div>
-			<div class="bar" style="width:' . $dispcurrdone . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥' . $ncurrdone . '">' . $dispcurrdone . '</div>
-			<div class="bar bar-gary" style="width:' . $dispnowtotal . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥' . $nnowtotal . '">' . $dispnowtotal . '</div>
-		    </div>
-		</td>
-		</tr>';
+                                    <td><a href="/rproject/' . $this->params['pid'] . '/section/' . $v['pmid'] . '/detail">' . $v['pmname'] . '</a></td>
+                                    <td class="">第 ' . $countNum . ' 期 ' . $buttonhtml . '</td>
+                                    <td class="taR">¥' . number_format($v['contracttotal'], 2, '.', ',') . '</td>
+                                    <td>
+                                        <div class="progress">
+                                        <div class="bar bar-success" style="width: ' . $dispstopnowtotal . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期完成:¥' . $nstopnowtotal . '">' . $dispstopnowtotal . '</div>
+                                        <div class="bar" style="width:' . $dispcurrdone . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥' . $ncurrdone . '">' . $dispcurrdone . '</div>
+                                        <div class="bar bar-gary" style="width:' . $dispnowtotal . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥' . $nnowtotal . '">' . $dispnowtotal . '</div>
+                                        </div>
+                                    </td>
+                                    </tr>';
                         $hetongTotal += $v['contracttotal'];
                     }
                 }
@@ -160,7 +188,11 @@ class RProjectController extends DooController
 
     function proSectionMeasure()
     {
-        $this->data['allproArray'] = $this->project->getAll();
+        $mpidArray = $this->measureauditact->getAuditProject($this->auth->getUid());
+        foreach ($mpidArray as $k1 => $v1) {
+            if ($v1['pid'] != $this->params['pid'])
+                $this->data['allproArray'][] = $this->project->getRowByPid($v1['pid']);
+        }
         $this->data['currproArray'] = $this->project->getRowByPid($this->params['pid']);
         $this->data['pid'] = $this->params['pid'];
         $this->data['mpid'] = $this->params['mpid'];
@@ -242,8 +274,13 @@ class RProjectController extends DooController
 
     public function proDetail()
     {
+        $numStatusArray = $this->numofperact->getLastRow($this->params['pid'], $this->params['pmid']);
         // 项目名称
-        $this->data['allproArray'] = $this->project->getAll();
+        $mpidArray = $this->measureauditact->getAuditProject2($this->auth->getUid());
+        foreach ($mpidArray as $k1 => $v1) {
+            if ($v1['pid'] != $this->params['pid'])
+                $this->data['allproArray'][] = $this->project->getRowByPid($v1['pid']);
+        }
         $this->data['currproArray'] = $this->project->getRowByPid($this->params['pid']);
         $this->data['MeasureArray'] = $this->numofperact->getGroupByLastOne($this->params['pmid']);
         $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
@@ -256,9 +293,138 @@ class RProjectController extends DooController
         }
         $this->data['pmid'] = $this->params['pmid'];
         $this->data['pid'] = $this->params['pid'];
+        $this->data['mpid'] = $numStatusArray['mpid'];
         $this->render('r-project-section-detail', $this->data, TRUE);
     }
 
+    public function proReport()
+    {
+        // 面包屑导航
+
+
+        // 期数列表
+        $tmpArray = $this->numofperact->getGroupByLastOne2($this->params['pmid']);
+        foreach ($tmpArray as $k => $v) {
+            $intTime = $this->numofperact->getMaxTimes($v['pmid'], $v['numpname'])['times'];
+            $nfArray[] = $this->numofperact->getRow($v['pmid'], $v['numpname'], $intTime);
+        }
+        foreach ($nfArray as $k => $v) {
+            if ($v['mpid'] == $this->params['mpid']) {
+                $this->data['mpid'] = $v['mpid'];
+                $this->data['MeasureArray2'][] = $v;
+                $this->data['currnum'] = $v['numpname'];
+            } else {
+                $this->data['numArray'][] = $v;
+            }
+        }
+        $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
+        foreach ($this->data['MeasureArray2'] as $key => $value) {
+            if ($value['mpid'] == $this->params['mpid']) {
+                $this->data['MeasureArray2'][$key]['currstatus'] = $this->statusArray[$value['currstatus']];
+                if ($measureArray['contracttotal'] > ($value['currdone'] > 0)) {
+                    $this->data['MeasureArray2'][$key]['lessTotal'] = round(($value['currdone'] / $measureArray['contracttotal']) * 100);
+                } else {
+                    $this->data['MeasureArray2'][$key]['lessTotal'] = 0;
+                }
+            }
+        }
+        //
+        $lastRowArray = $this->numofperact->getLastNew2($this->params['pmid']);
+        $maxTimes = $this->numofperact->getMaxTimes($lastRowArray['pmid'], $lastRowArray['numpname']);
+//        $auditUserArray = $this->measureauditact->getAllAudit($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times']);
+        $maxtimez = $this->measureauditact->getRowGroupByTimes($this->params['mpid']);
+        $auditUserArray = $this->measureauditact->getRowByMpidTimes($this->params['mpid'], $maxtimez['times']);
+        $auditArray = $this->measureauditact->getLastNewRowInfo($lastRowArray['pmid'], $lastRowArray['numpname'], $this->auth->getUid());
+        if (isset($_POST['act'])) {
+            $auditStatusArray = array('checkno', 'checked');
+            $myAuditStatus = $this->measureauditact->getMyAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times'], $this->auth->getUid());
+            if (in_array($myAuditStatus['mastatus'], $auditStatusArray)) {
+                echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
+                die();
+            }
+        }
+        if ($_POST['act'] == 'p') {
+            if ($this->measureauditact->setMyAuditPass($auditArray['maid'], $_POST['content'], 1, $this->auth->getUid())) {
+                $countAudit = count($auditUserArray);
+                $this->attfile->updateHash($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times']);
+                if ($auditArray['last'] == 1) {
+                    $this->numofperact->updateAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], 'checked', $maxTimes['times']);
+                    echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
+                    die();
+                } else {
+                    if (($countAudit == 2) && ($auditUserArray[1]['last'] == 1) && ($auditUserArray[0]['maid'] == $auditArray['maid'])) {
+                        $this->measureauditact->updateMastatus($auditUserArray[1]['maid']);
+                        $this->numofperact->updateAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], 'checking', $maxTimes['times']);
+                        echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
+                        die();
+                    }
+                    if (($countAudit > 2)) {
+                        foreach ($auditUserArray as $k => $v) {
+                            if ($v['maid'] == $auditArray['maid']) {
+                                if ($k == ($countAudit - 1)) {//如果是最后一个
+                                    $this->measureauditact->updateMastatus($auditUserArray[0]['maid']);
+                                } else {
+                                    $this->measureauditact->updateMastatus($auditUserArray[$k + 1]['maid']);
+                                }
+                                $this->numofperact->updateAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], 'checking', $maxTimes['times']);
+                                echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
+                                die();
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        if ($_POST['act'] == 'np') {
+            $this->measureauditact->setCheckno($auditArray['maid'], $_POST['content'], 1);
+            $this->numofperact->updateAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], 'checkno', $maxTimes['times']);
+            $this->attfile->updateHash($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times']);
+            echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
+            die();
+        }
+        $this->data['pmid'] = $lastRowArray['pmid'];
+        $this->data['numpname'] = $lastRowArray['numpname'];
+        $this->data['times'] = $lastRowArray['times'];
+        $this->data['pid'] = $this->params['pid'];
+        foreach ($auditUserArray as $key => $value) {
+            $strAvatar = $this->auth->getAvatar($value['auditoruid']);
+            $i = $key + 1;
+            if ($value['auditoruid'] == $this->auth->getUid()) {
+                $this->data['mastatus'] = $value['mastatus'];
+                $this->data['maid'] = $value['maid'];
+            }
+            if ($value['mastatus'] == 'uncheck') {
+                $statuStr = '';
+                $statucolorStr = '';
+                $statushtml = '<li title="" class=""><img src="' . $strAvatar . '"></li>';
+            }
+            if ($value['mastatus'] == 'checking') {
+                $statuStr = '<h4 class="colOrange">审批中</h4>';
+                $statucolorStr = 'colOrange';
+                $statushtml = '<li title="审批中" class="wait"><span data-icon="k" aria-hidden="true"></span> <img src="' . $strAvatar . '"></li>';
+            }
+            if ($value['mastatus'] == 'checked') {
+                $statuStr = '<h4 class="colGreen">审批完成(' . date('Y-m-d', $value['audittime']) . ')</h4>';
+                $statucolorStr = 'colGreen';
+                $statushtml = '<li title="审批通过" class="pass"><span data-icon="d" aria-hidden="true"></span><img src="' . $strAvatar . '"></li>';
+            }
+            if ($value['mastatus'] == 'checkno') {
+                $statuStr = '<h4 class="colRed">审批不通过(' . date('Y-m-d', $value['audittime']) . ')</h4>';
+                $statucolorStr = 'colRed';
+                $statushtml = '<li title="审批不通过" class="notpass"><span data-icon="e" aria-hidden="true"></span><img src="' . $strAvatar . '"></li>';
+            }
+            $auditUserArray[$key]['statuStr'] = $statuStr;
+            $auditUserArray[$key]['statucolorStr'] = $statucolorStr;
+            $auditUserArray[$key]['statushtml'] = $statushtml;
+            $auditUserArray[$key]['k'] = $i;
+            $auditUserArray[$key]['name'] = $this->profile->getProWithUid($value['auditoruid'])['name'];
+        }
+        $this->data['auditArray'] = $auditUserArray;
+        $this->data['pmid'] = $this->params['pmid'];
+        $this->data['pid'] = $this->params['pid'];
+        $this->data['mpid'] = $this->params['mpid'];
+        $this->render('r-project-section-report', $this->data, TRUE);
+    }
 }
 
 ?>

+ 13 - 3
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() {
@@ -144,13 +154,13 @@ class SProjectController extends DooController {
             }
             $this->data['MeasureArray'][$key]['nless'] = number_format($value['contracttotal'] - $this->data['MeasureArray'][$key]['stopnow'] - $this->data['MeasureArray'][$key]['currdone'], 2, '.', ',');
             $tenderArray = $this->numofperact->getRowTender2($value['pmid']);
-            $this->data['MeasureArray'][$key]['ownstatus'] = '审中';
+            $this->data['MeasureArray'][$key]['ownstatus'] = '审中';
             $ownerStatusArray = $this->measureauditact->getStatusTen($tenderArray['pmid'], $tenderArray['numpname']);
             if (isset($ownerStatusArray[0]['last']) && isset($ownerStatusArray[0]['mastatus']))
                 if (($ownerStatusArray[0]['last'] == 1) && ($ownerStatusArray[0]['mastatus'] == 'checked')) {
-                    $this->data['MeasureArray'][$key]['ownstatus'] = '已审';
+                    $this->data['MeasureArray'][$key]['ownstatus'] = '已审';
                 } else {
-                    $this->data['MeasureArray'][$key]['ownstatus'] = '审中';
+                    $this->data['MeasureArray'][$key]['ownstatus'] = '审中';
                 }
         }
         $this->render('s-project-section', $this->data, TRUE);

+ 2 - 1
protected/model/measureaudit.php

@@ -21,9 +21,10 @@ class MeasureAudit extends DooModel {
     public $audittime;
     public $auditcontent;
     public $intime;
+    public $onlineaudit;
     public $_table = 'jl_measure_audit';
     public $_primarykey = 'maid';
-    public $_fields = array('maid', 'pid', 'creatoruid', 'auditoruid', 'mpid', 'pmid', 'stid', 'numpname', 'times', 'mastatus', 'last', 'audittime', 'auditcontent', 'intime');
+    public $_fields = array('maid', 'pid', 'creatoruid', 'auditoruid', 'mpid', 'pmid', 'stid', 'numpname', 'times', 'mastatus', 'last', 'audittime', 'auditcontent', 'intime','onlineaudit');
 
     public function __construct() {
         parent::setupModel(__CLASS__);

+ 3 - 3
protected/module/admin/controller/ItemController.php

@@ -24,7 +24,7 @@ Doo::loadClass('project');
 // 管理员修改密码
 class ItemController extends DooController {
 
-    private $data, $users, $user, $profile, $ph, $userz, $mailer, $project, $am, $cc, $an, $ama, $statusArray = array('checking' => '审中', 'checked' => '完成', 'checkno' => '不通过'), $colorArray = array('checking' => 'colOrange', 'checked' => 'colGreen', 'checkno' => 'colRed');
+    private $data, $users, $user, $profile, $ph, $userz, $mailer, $project, $am, $cc, $an, $ama, $statusArray = array('checking' => '审中', 'checked' => '完成', 'checkno' => '不通过'), $colorArray = array('checking' => 'colOrange', 'checked' => 'colGreen', 'checkno' => 'colRed');
 
     public function beforeRun($resource, $action) {
         if (!isset($_SESSION['auid'])) {
@@ -162,9 +162,9 @@ class ItemController extends DooController {
     }
 
     function itemList() {
-        // TODO:增加判断审核人期数和上报最新期数比较来显示是否需要显示删除审核人操作
+        // TODO:增加判断审批人期数和上报最新期数比较来显示是否需要显示删除审批人操作
         // TODO:提示信息:可能显示的是瞬时状态,需要与客户经过确认之后方可删除。
-        // TODO:审核人状态和标段状态暂未加入审核人与标段是否一直的判断
+        // TODO:审批人状态和标段状态暂未加入审批人与标段是否一直的判断
         if ($this->params['pid'] > 0) {
             $mArray = $this->am->getRowAll($this->params['pid']);
             $this->data['pid'] = $this->params['pid'];

+ 2 - 2
protected/module/admin/controller/RestoreController.php

@@ -52,9 +52,9 @@ class RestoreController extends DooController {
 
     function restoreRedo() {
         /**
-         *  存在最新的审人员列表与最新一期的提交数据不匹配 与其数不匹配问题 (添加判断机制) 
+         *  存在最新的审人员列表与最新一期的提交数据不匹配 与其数不匹配问题 (添加判断机制) 
          *  最新一次不显示单选按钮
-         *  接口是否也可以更改为当期数数据存在的情况下才显示最新的审核人列表 显示当前期最新的审核人员列表可以这么改
+         *  接口是否也可以更改为当期数数据存在的情况下才显示最新的审批人列表 显示当前期最新的审批人员列表可以这么改
          *  更新全部参与项目是否可以这么修改?哦,应该可以上述问题修改之后,那就可以按照如果不存在这一期数据就返回上一期或者次数数据
          */
         $measureArray = $this->am->getOne(array('where' => 'pmid=?', 'param' => array($this->params['pmid']), 'asArray' => TRUE));

+ 1 - 1
protected/module/admin/view/admin-restore-list.html

@@ -25,7 +25,7 @@
                         <fieldset>
                             <legend>标段还原</legend>
                             <div class="control-group">
-                                <label class="control-ndname">标段名称:{{measurearray.pmname}}<span class="Reminder">(请勾选下列还原的期数和审状态。)</span></label>
+                                <label class="control-ndname">标段名称:{{measurearray.pmname}}<span class="Reminder">(请勾选下列还原的期数和审状态。)</span></label>
                             </div>
                             <div class="control-group">
                                 <!-- loop numofperArray -->

+ 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>-->

+ 9 - 2
protected/view/r-project-section-detail.html

@@ -22,7 +22,7 @@
 		<div class="mainContent">
 		    <div class="title clearfix">
 			<ul class="nav nav-pills">
-			    <li class="dropdown"><a title="返回" href="r-project-section.html"><span class="closePanel" aria-hidden="true" data-icon="Z"></span></a></li>
+			    <li class="dropdown"><a title="返回" href="{{rootUrl}}rproject/{{pid}}/section"><span class="closePanel" aria-hidden="true" data-icon="Z"></span></a></li>
 			    <li class="dropdown">
 				<a href="{{rootUrl}}sproject/{{currproArray.pid}}/section" data-toggle="dropdown" class="dropdown-toggle">
 				    {{currproArray.pname}}<b class="caret"></b>
@@ -69,7 +69,14 @@
 			<li class="active">
 			    <a href="{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/detail">标段概况</a>
 			</li>
-			<!--<li><a href="/rproject/{{pid}}/section/{{pmid}}/measure">计量台帐</a></li>-->
+            <!--<li>-->
+                <!--<a href="/rproject/{{pid}}/section/{{pmid}}/measure">审批</a>-->
+            <!--</li>-->
+                <!-- if {{mpid}}>0 -->
+			<li>
+                <a href="{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/report/{{mpid}}">审批</a>
+            </li>
+                <!-- endif -->
 		    </ul>
 		    <!--导航-->
 		    <div class="project">

文件差异内容过多而无法显示
+ 189 - 0
protected/view/r-project-section-report.html


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

@@ -43,7 +43,7 @@
 			    <table class="table">
 				<thead>
 				    <tr>
-					<td width="150"><span aria-hidden="true" data-icon="u"></span> {{conArray' value.stname}} <a href="#secoption" data-toggle="modal" title="编辑/查看KEY"><span data-icon="S" aria-hidden="true" class="closePanel"></span></a></td>
+					<td width="150"><span aria-hidden="true" data-icon="u"></span> {{conArray' value.stname}}</td>
 					<td width="90">总价:</td><td width="165">¥<b style="font-size:16px">{{conArray' value.hetongTotal}}</b></td>
 					<td width="60">完成进度:</td>
 					<td>

+ 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">{{proArray' value.pid}}(<b>第七期</b>)</p><p><a href="{{rootUrl}}rproject/{{proArray' value.pid}}/section/{{proArray' value.pid}}/measure" class="btn btn-warning btn-small">开始审批</a></p><p><b class="colGreen">已完成</b></p><p><b class="colOrange">待审批</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 -->

+ 1 - 1
protected/view/w-project-detail.html

@@ -195,7 +195,7 @@
 										name: '金额',
 										position: 'left',
 										axisLabel: {
-										formatter: '{value}'
+										formatter: '{value}'
 										},
 										splitArea: {show: true}
 									},