浏览代码

2.0.0 no.1 up

likeku 8 年之前
父节点
当前提交
bff5b6b8a6

+ 5 - 0
protected/class/measureauditact.php

@@ -233,6 +233,11 @@ class MeasureauditAct
         return $this->__measureaudit->update(array('where' => 'maid=?', 'param' => array($maid)));
     }
 
+    public function setUncheck($maid){
+        $this->__measureaudit->mastatus = 'uncheck';
+        return $this->__measureaudit->update(array('where' => 'maid=?', 'param' => array($maid)));
+    }
+
     public function setStatusTo($maid, $status = 3, $auditcontent = null, $isonline = 0)
     {
         $ma1 = new MeasureAudit();

+ 1 - 1
protected/config/ver.conf.php

@@ -1,5 +1,5 @@
 <?php
 
 // Version
-$config['ver'] = 'v1.9.0';
+$config['ver'] = 'v2.0.0';
 

+ 82 - 20
protected/controller/RProjectController.php

@@ -335,13 +335,19 @@ class RProjectController extends DooController
         // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
+        $auditArray = $this->measureauditact->getUserPmid($this->auth->getUid());
+        foreach ($auditArray as $key => $value) {
+            $pmidArray[] = $value['pmid'];
+        }
         $actmeasureArray = $this->actmeasure->getAll();
         foreach ($actmeasureArray as $kkkk => $vvvv) {
             if ($vvvv['stid'] == $measureArray['stid']) {
-                if (($vvvv['pmid'] == $this->params['pmid'])) {
-                    $this->data['curractmeasureArray'] = $vvvv;
-                } else {
-                    $this->data['allactmeasureArray'][] = $vvvv;
+                if(in_array($vvvv['pmid'],$pmidArray)){
+                    if (($vvvv['pmid'] == $this->params['pmid'])) {
+                        $this->data['curractmeasureArray'] = $vvvv;
+                    } else {
+                        $this->data['allactmeasureArray'][] = $vvvv;
+                    }
                 }
             }
         }
@@ -448,13 +454,19 @@ class RProjectController extends DooController
         // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
+        $auditArray = $this->measureauditact->getUserPmid($this->auth->getUid());
+        foreach ($auditArray as $key => $value) {
+            $pmidArray[] = $value['pmid'];
+        }
         $actmeasureArray = $this->actmeasure->getAll();
         foreach ($actmeasureArray as $kkkk => $vvvv) {
             if ($vvvv['stid'] == $measureArray['stid']) {
-                if (($vvvv['pmid'] == $this->params['pmid'])) {
-                    $this->data['curractmeasureArray'] = $vvvv;
-                } else {
-                    $this->data['allactmeasureArray'][] = $vvvv;
+                if(in_array($vvvv['pmid'],$pmidArray)){
+                    if (($vvvv['pmid'] == $this->params['pmid'])) {
+                        $this->data['curractmeasureArray'] = $vvvv;
+                    } else {
+                        $this->data['allactmeasureArray'][] = $vvvv;
+                    }
                 }
             }
         }
@@ -635,13 +647,19 @@ class RProjectController extends DooController
         // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
+        $auditArray = $this->measureauditact->getUserPmid($this->auth->getUid());
+        foreach ($auditArray as $key => $value) {
+            $pmidArray[] = $value['pmid'];
+        }
         $actmeasureArray = $this->actmeasure->getAll();
         foreach ($actmeasureArray as $kkkk => $vvvv) {
             if ($vvvv['stid'] == $measureArray['stid']) {
-                if (($vvvv['pmid'] == $this->params['pmid'])) {
-                    $this->data['curractmeasureArray'] = $vvvv;
-                } else {
-                    $this->data['allactmeasureArray'][] = $vvvv;
+                if(in_array($vvvv['pmid'],$pmidArray)){
+                    if (($vvvv['pmid'] == $this->params['pmid'])) {
+                        $this->data['curractmeasureArray'] = $vvvv;
+                    } else {
+                        $this->data['allactmeasureArray'][] = $vvvv;
+                    }
                 }
             }
         }
@@ -690,13 +708,19 @@ class RProjectController extends DooController
         // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
+        $auditArray = $this->measureauditact->getUserPmid($this->auth->getUid());
+        foreach ($auditArray as $key => $value) {
+            $pmidArray[] = $value['pmid'];
+        }
         $actmeasureArray = $this->actmeasure->getAll();
         foreach ($actmeasureArray as $kkkk => $vvvv) {
             if ($vvvv['stid'] == $measureArray['stid']) {
-                if (($vvvv['pmid'] == $this->params['pmid'])) {
-                    $this->data['curractmeasureArray'] = $vvvv;
-                } else {
-                    $this->data['allactmeasureArray'][] = $vvvv;
+                if(in_array($vvvv['pmid'],$pmidArray)){
+                    if (($vvvv['pmid'] == $this->params['pmid'])) {
+                        $this->data['curractmeasureArray'] = $vvvv;
+                    } else {
+                        $this->data['allactmeasureArray'][] = $vvvv;
+                    }
                 }
             }
         }
@@ -828,16 +852,41 @@ class RProjectController extends DooController
             echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
             die();
         }
+        if($_POST['act'] == 'back') {
+            $this->measureauditact->setUncheck($auditArray['maid']);
+            $this->numofperact->updateAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], 'checking', $maxTimes['times']);
+
+            //获取并改变上一个审批人为审批中状态
+            $lastmeasureauditact = $this->measureauditact->getMyAuditStatus($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times'], $_POST['last']);
+            $this->measureauditact->updateMastatus($lastmeasureauditact['maid']);
+            // SMS Start
+            $TenderArray = $this->actmeasure->getRowByPmid($lastRowArray['pmid']);
+            $userProArray = $this->profile->getProWithUid($_POST['last']);
+            if (isset($userProArray) && ($userProArray['mobile'])) {// // XXXX(标段名),陈特,已审批通过。请您继续审批。
+                $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . '您好,' . $TenderArray["pmname"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR4"]);
+            }
+            // SMS End
+            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'];
+        $firstUser = 0;
         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($key == 0){
+                    $firstUser = 1;
+                }else{
+                    $this->data['lastUserID'] = $auditUserArray[$key-1]['auditoruid'];
+                    $this->data['lastUsername'] = $this->profile->getProWithUid($auditUserArray[$key-1]['auditoruid'])['name'];
+                    $this->data['lastUserCompany'] = $this->profile->getProWithUid($auditUserArray[$key-1]['auditoruid'])['company'];
+                }
             }
             if ($value['mastatus'] == 'uncheck') {
                 $statuStr = '';
@@ -877,6 +926,7 @@ class RProjectController extends DooController
         $this->data['pmid'] = $this->params['pmid'];
         $this->data['pid'] = $this->params['pid'];
         $this->data['mpid'] = $this->params['mpid'];
+        $this->data['firstUser'] = $firstUser;
         $this->render('r-project-section-report', $this->data, TRUE);
     }
 
@@ -930,13 +980,19 @@ class RProjectController extends DooController
         // 面包屑导航标段
         $this->data['curractmeasureArray'] = NULL;
         $this->data['allactmeasureArray'] = [];
+        $auditArray = $this->measureauditact->getUserPmid($this->auth->getUid());
+        foreach ($auditArray as $key => $value) {
+            $pmidArray[] = $value['pmid'];
+        }
         $actmeasureArray = $this->actmeasure->getAll();
         foreach ($actmeasureArray as $kkkk => $vvvv) {
             if ($vvvv['stid'] == $measureArray['stid']) {
-                if (($vvvv['pmid'] == $this->params['pmid'])) {
-                    $this->data['curractmeasureArray'] = $vvvv;
-                } else {
-                    $this->data['allactmeasureArray'][] = $vvvv;
+                if(in_array($vvvv['pmid'],$pmidArray)){
+                    if (($vvvv['pmid'] == $this->params['pmid'])) {
+                        $this->data['curractmeasureArray'] = $vvvv;
+                    } else {
+                        $this->data['allactmeasureArray'][] = $vvvv;
+                    }
                 }
             }
         }
@@ -998,6 +1054,11 @@ class RProjectController extends DooController
             }
         }
 
+        $numStatusArray = $this->numofperact->getLastStatus3($this->params['pid'], $this->params['pmid']);
+        if (!isset($numStatusArray['currstatus'])) {
+            $numStatusArray['currstatus'] = 'uncheck';
+        }
+
         $this->data['list'] = isset($list) ? $list : '';
         $this->data['phasenolist'] = isset($phasenolist) ? $phasenolist : '';
         $this->data['pager'] = $pager->output;
@@ -1005,6 +1066,7 @@ class RProjectController extends DooController
 
         $this->data['pid'] = $this->params['pid'];
         $this->data['pmid'] = $this->params['pmid'];
+        $this->data['mpid'] = $numStatusArray['mpid'];
         $this->render('r-project-section-intermediate', $this->data, TRUE);
     }
 

+ 25 - 3
protected/view/r-project-section-report.html

@@ -148,6 +148,7 @@
                             <a class="btn btn-success" data-toggle="modal" href="#reportPass"><span aria-hidden="true"
                                                                                                     data-icon="d"></span>&nbsp;审批通过</a>
                         </div>
+                        <!-- if {{firstUser}} == 0 --><a class="btn btn-warning" data-toggle="modal" href="#reportBack"><span aria-hidden="true" data-icon="d"></span>&nbsp;退回</a><!-- endif -->
                         <a type="button" class="btn btn-danger" data-toggle="modal" href="#reportNopass"><span
                                 aria-hidden="true" data-icon="e"></span>&nbsp;审批不通过</a>
                     </div>
@@ -216,13 +217,33 @@
             <div class="modal-footer">
                 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
                 <button class="btn btn-success auditclass" act="p" maid="{{maid}}" pmid="{{pmid}}" numpname="{{numpname}}"
-                        times="{{times}}" id="pass">确认审批通过
+                        times="{{times}}" last="" id="pass">确认审批通过
                 </button>
             </div>
         </div>
     </div>
 </div>
 <!-- 审批通过 -->
+<!-- if {{firstUser}} == 0 -->
+<!-- 退回 -->
+<div id="reportBack" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">      <div class="modal-dialog">
+    <div class="modal-content">
+        <div class="modal-header">
+            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+            <h4 class="modal-title">退回</h4>
+        </div>
+        <div class="modal-body">
+            <h4>是否退回给上一审批人"{{lastUsername}}<!-- if !empty({{lastUserCompany}}) -->({{lastUserCompany}})<!-- endif -->"重新审批?</h4>
+        </div>
+        <div class="modal-footer">
+            <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
+            <button class="btn btn-warning auditclass" act="back" maid="{{maid}}" pmid="{{pmid}}" numpname="{{numpname}}" times="{{times}}" last="{{lastUserID}}" id="back">确认退回</button>
+        </div>
+    </div>
+</div>
+</div>
+<!-- 退回 -->
+<!-- endif -->
 <!-- 审批不通过 -->
 <div id="reportNopass" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
      aria-hidden="true">
@@ -244,7 +265,7 @@
             <div class="modal-footer">
                 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
                 <button class="btn btn-danger auditclass" act="np" maid="{{maid}}" pmid="{{pmid}}" numpname="{{numpname}}"
-                        times="{{times}}">确认审批不通过
+                        times="{{times}}" last="">确认审批不通过
                 </button>
             </div>
         </div>
@@ -261,11 +282,12 @@
             var content = $(this).parent().parent().find("textarea").val();
             var act = $(this).attr('act');
             var maid = $(this).attr('maid');
+            var last = $(this).attr('last');
             $.ajax({
                 type: "POST",
                 dataType: "json",
                 cache: false,
-                data: {"act": act, "pmid": pmid, "numpname": numpname, "times": times, "content": content},
+                data: {"act": act, "pmid": pmid, "numpname": numpname, "times": times, "content": content, "last": last},
                 url: "/rproject/{{pid}}/section/{{pmid}}/report/{{mpid}}",
                 success: function (data) {
                     if (data['status'] == 1) {

+ 23 - 23
protected/view/s-project-section.html

@@ -43,35 +43,35 @@
 						</div>
 					</div>
 					<!--图表5-->
-					<!--表-->
 					<div class="fL" style="width:70%;height:300px;overflow:hide">
-						<table class="table table-striped">
-							<thead>
-							<tr>
-								<th width="15%">标段名</th><th width="16%" class="taC">总价/期数</th><th width="40%" class="taC">截止上期完成/本期完成/未完成</th>
-							</tr>
-							</thead>
-						</table>
-						<div style="height:264px;overflow-y:auto">
-							<table class="table table-striped">
-								<!-- loop MeasureArray -->
-								<tr>
-									<td width="15%"><a href="{{rootUrl}}sproject/{{MeasureArray' value.pid}}/section/{{MeasureArray' value.pmid}}/detail">{{MeasureArray' value.pmname}}</a><br>{{MeasureArray' value.type}}</td><td width="16%" class="taR">¥<b>{{MeasureArray' value.totalplus}}</b><br>第 {{MeasureArray' value.totalnum}} 期(<span class="colOrange">{{MeasureArray' value.ownstatus}}</span>)</td><td width="40%" class="taR"><div class="progress">
-									<div data-original-title="截止上期完成:¥{{MeasureArray' value.nstopnow}}" data-toggle="tooltip" data-placement="bottom" style="width: {{MeasureArray' value.dispstopnow}};" class="progress-bar progress-bar-success">{{MeasureArray' value.dispstopnow}}</div>
-									<div data-original-title="本期完成:¥{{MeasureArray' value.ncurrdone}}" data-toggle="tooltip" data-placement="bottom" style="width:{{MeasureArray' value.dispcurrdone}}" class="progress-bar">{{MeasureArray' value.dispcurrdone}}</div>
-									<div data-original-title="未完成:¥{{MeasureArray' value.nless}}" data-toggle="tooltip" data-placement="bottom" style="width:{{MeasureArray' value.pless}}" class="progress-bar progress-bar-gary">{{MeasureArray' value.pless}}</div>
-								</div></td>
-								</tr>
-								<!-- endloop -->
-							</table>
+						<div id="chartContainer7" style="height: 300px; width: 100%;">
 						</div>
 					</div>
-					<!--表-->
 				</div>
+				<!--表-->
 				<div class="proSection clearfix">
-					<div id="chartContainer7" style="height: 300px; width: 100%;">
-					</div>
+					<table class="table table-striped">
+						<thead>
+						<tr>
+							<th width="15%">标段名</th><th width="16%" class="taC">总价/期数</th><th width="40%" class="taC">截止上期完成/本期完成/未完成</th>
+						</tr>
+						</thead>
+					</table>
+					<!--<div style="height:264px;overflow-y:auto">-->
+						<table class="table table-striped">
+							<!-- loop MeasureArray -->
+							<tr>
+								<td width="15%"><a href="{{rootUrl}}sproject/{{MeasureArray' value.pid}}/section/{{MeasureArray' value.pmid}}/detail">{{MeasureArray' value.pmname}}</a><br>{{MeasureArray' value.type}}</td><td width="16%" class="taR">¥<b>{{MeasureArray' value.totalplus}}</b><br>第 {{MeasureArray' value.totalnum}} 期(<span class="colOrange">{{MeasureArray' value.ownstatus}}</span>)</td><td width="40%" class="taR"><div class="progress">
+								<div data-original-title="截止上期完成:¥{{MeasureArray' value.nstopnow}}" data-toggle="tooltip" data-placement="bottom" style="width: {{MeasureArray' value.dispstopnow}};" class="progress-bar progress-bar-success">{{MeasureArray' value.dispstopnow}}</div>
+								<div data-original-title="本期完成:¥{{MeasureArray' value.ncurrdone}}" data-toggle="tooltip" data-placement="bottom" style="width:{{MeasureArray' value.dispcurrdone}}" class="progress-bar">{{MeasureArray' value.dispcurrdone}}</div>
+								<div data-original-title="未完成:¥{{MeasureArray' value.nless}}" data-toggle="tooltip" data-placement="bottom" style="width:{{MeasureArray' value.pless}}" class="progress-bar progress-bar-gary">{{MeasureArray' value.pless}}</div>
+							</div></td>
+							</tr>
+							<!-- endloop -->
+						</table>
+					<!--</div>-->
 				</div>
+				<!--表-->
 			</div>
 		</div>
 		<!--内容-->