|
@@ -128,15 +128,15 @@ class RProjectController extends DooController
|
|
|
if (!isset($numStatusArray['currstatus'])) {
|
|
|
$numStatusArray['currstatus'] = 'uncheck';
|
|
|
}
|
|
|
- $datatmp = $this->measureauditact->getMyAuditStatus($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{
|
|
|
+ $datatmp = $this->measureauditact->getMyAuditStatus($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 . ' 期 '.$buttonhtml.'</td>
|
|
|
+ <td class="">第 ' . $countNum . ' 期 ' . $buttonhtml . '</td>
|
|
|
<td class="taR">¥' . number_format($v['contracttotal'], 2, '.', ',') . '</td>
|
|
|
<td>
|
|
|
<div class="progress">
|
|
@@ -272,18 +272,18 @@ class RProjectController extends DooController
|
|
|
|
|
|
// 期数列表
|
|
|
$tmpArray = $this->numofperact->getGroupByLastOne($this->params['pmid']);
|
|
|
- foreach($tmpArray as $k => $v){
|
|
|
- if($v['mpid']==$this->params['mpid']){
|
|
|
+ foreach ($tmpArray as $k => $v) {
|
|
|
+ if ($v['mpid'] == $this->params['mpid']) {
|
|
|
$this->data['currnum'] = $v['numpname'];
|
|
|
$this->data['mpid'] = $v['mpid'];
|
|
|
$this->data['MeasureArray2'][] = $v;
|
|
|
- }else{
|
|
|
+ } 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']){
|
|
|
+ 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);
|
|
@@ -294,11 +294,19 @@ class RProjectController extends DooController
|
|
|
}
|
|
|
//
|
|
|
$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']);
|
|
|
+ $maxTimes = $this->numofperact->getMaxTimes($lastRowArray['pmid'], $lastRowArray['numpname']);
|
|
|
+ $auditUserArray = $this->measureauditact->getAllAudit($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times']);
|
|
|
$auditArray = $this->measureauditact->getLastNewRowInfo($lastRowArray['pmid'], $lastRowArray['numpname'], $this->auth->getUid());
|
|
|
- if($_POST['act'] == 'p'){
|
|
|
- if ($this->measureauditact->setStatusTo($auditArray['maid'], 3, $_POST['content'],1)) {
|
|
|
+ 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->setStatusTo($auditArray['maid'], 3, $_POST['content'], 1)) {
|
|
|
$countAudit = count($auditUserArray);
|
|
|
if ($auditArray['last'] == '1') {
|
|
|
$this->measureauditact->setStatusTo($auditUserArray[0]['maid'], 3);
|
|
@@ -330,8 +338,8 @@ class RProjectController extends DooController
|
|
|
$this->attfile->updateHash($lastRowArray['pmid'], $lastRowArray['numpname'], $maxTimes['times']);
|
|
|
}
|
|
|
}
|
|
|
- if($_POST['act'] == 'np'){
|
|
|
- $this->measureauditact->setCheckno($auditArray['maid'], $_POST['content'],1);
|
|
|
+ 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);
|
|
@@ -341,31 +349,31 @@ class RProjectController extends DooController
|
|
|
$this->data['numpname'] = $lastRowArray['numpname'];
|
|
|
$this->data['times'] = $lastRowArray['times'];
|
|
|
$this->data['pid'] = $this->params['pid'];
|
|
|
- foreach($auditUserArray as $key => $value){
|
|
|
- if($value['auditoruid']==$this->auth->getUid()){
|
|
|
+ foreach ($auditUserArray as $key => $value) {
|
|
|
+ if ($value['auditoruid'] == $this->auth->getUid()) {
|
|
|
$this->data['mastatus'] = $value['mastatus'];
|
|
|
$this->data['maid'] = $value['maid'];
|
|
|
}
|
|
|
- if($value['mastatus']=='uncheck'){
|
|
|
+ if ($value['mastatus'] == 'uncheck') {
|
|
|
$statuStr = '';
|
|
|
$statucolorStr = '';
|
|
|
$classStr = '';
|
|
|
$icoStr = '';
|
|
|
}
|
|
|
- if($value['mastatus']=='checking'){
|
|
|
+ if ($value['mastatus'] == 'checking') {
|
|
|
$statuStr = '<h4 class="colOrange">审核中</h4>';
|
|
|
$statucolorStr = 'colOrange';
|
|
|
$classStr = 'wait';
|
|
|
$icoStr = 'k';
|
|
|
}
|
|
|
- if($value['mastatus']=='checked'){
|
|
|
- $statuStr = '<h4 class="colGreen">审批完成('.date('Y-m-d',$value['audittime']).')</h4>';
|
|
|
- $statucolorStr = 'colGreen';
|
|
|
+ if ($value['mastatus'] == 'checked') {
|
|
|
+ $statuStr = '<h4 class="colGreen">审批完成(' . date('Y-m-d', $value['audittime']) . ')</h4>';
|
|
|
+ $statucolorStr = 'colGreen';
|
|
|
$classStr = 'pass';
|
|
|
$icoStr = 'd';
|
|
|
}
|
|
|
- if($value['mastatus']=='checkno'){
|
|
|
- $statuStr = '<h4 class="colRed">审批不通过('.date('Y-m-d',$value['audittime']).')</h4>';
|
|
|
+ if ($value['mastatus'] == 'checkno') {
|
|
|
+ $statuStr = '<h4 class="colRed">审批不通过(' . date('Y-m-d', $value['audittime']) . ')</h4>';
|
|
|
$statucolorStr = 'colRed';
|
|
|
$classStr = 'notpass';
|
|
|
$icoStr = 'e';
|