12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088 |
- <?php
- Doo::loadClass('auth');
- Doo::loadClass('attfile');
- Doo::loadClass('profile');
- Doo::loadClass('project');
- Doo::loadClass('contractact');
- Doo::loadClass('actmeasure');
- Doo::loadClass('measureauditact');
- Doo::loadClass('numofperact');
- Doo::loadModelAt('aconfig', 'admin');
- Doo::loadClass('sms');
- Doo::loadClass('itemmeasurenum');
- Doo::loadClass('itemfile');
- Doo::loadClass('attachment');
- Doo::loadHelper('DooPager');
- Doo::loadClass('sign');
- /**
- * MainController
- * Feel free to delete the methods and replace them with your own code.
- *
- * @author darkredz
- */
- class RProjectController extends DooController
- {
- private $data, $sign, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '未审批', 'checking' => '审批中', 'checked' => '已审批', 'checkno' => '未通过'), $aconfig, $sms, $itemfile, $itemmeasurenum, $itemfle, $att;
- public function __construct()
- {
- $this->auth = new Auth();
- $this->attfile = new attFile();
- $this->profile = new Profile();
- $this->project = new Project();
- $this->contractact = new Contractact();
- $this->actmeasure = new actMeasure();
- $this->measureauditact = new MeasureauditAct();
- $this->numofperact = new NumofperAct();
- $this->itemfile = new ItemFile();
- $this->itemmeasurenum = new ItemMeasureNumpofper();
- $this->aconfig = new AConfig();
- $this->itemfle = new ItemFile();
- $this->att = new attachment();
- $this->sign = new Signn();
- $this->sms = new Sms(Doo::conf()->SMS_URL, Doo::conf()->SMS_AUTHKEY);
- $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 (!isset($this->data['numofchecking']) || $this->data['numofchecking'] == 0) {
- $this->data['numofchecking'] = null;
- }
- $this->data['signSwitch'] = $this->aconfig->getOne(array('select' => 'signswitch', 'asArray' => TRUE))['signswitch'];
- //获取需要您签署的数目
- if($this->data['signSwitch'] > 0)
- $this->data['needSignNum'] = $this->sign->getNeedSignNumbyUid($this->auth->getUid()) != 0 ? $this->sign->getNeedSignNumbyUid($this->auth->getUid()) : '';
- //获取桌面版本
- $this->getsoftware();
- //草图入口
- $this->data['imediateSwitch'] = $this->aconfig->getOne(array('select' => 'imediateswitch', 'asArray' => TRUE))['imediateswitch'];
- }
- function getsoftware(){
- $StrJson = ($this->aconfig->getOne(array('select' => 'upgradeinfo', 'asArray' => TRUE))['upgradeinfo']);
- $upgradeinfo = json_decode($StrJson, true);
- if ($upgradeinfo) {
- $this->data['version'] = $upgradeinfo['version'];
- $this->data['download'] = $upgradeinfo['download'];
- }
- }
- public function beforeRun($resource, $action)
- {
- // $uGroups = $this->profile->getProWithUid($this->auth->getUid());
- // $falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
- // if (!$falg)
- // return Doo::acl()->defaultFailedRoute;
- 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 {
- return Doo::acl()->defaultFailedRoute;
- }
- }
- public function index()
- {
- $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'];
- $this->data['proArray'][$key]['currdone'] = $this->numofperact->getCurrDoneNow($value['pid']);
- if (($this->data['proArray'][$key]['contracttotal'] > 0) && ($this->data['proArray'][$key]['currdone'] > 0)) {
- $this->data['proArray'][$key]['pcurrdone'] = round(($this->data['proArray'][$key]['currdone'] / $this->data['proArray'][$key]['contracttotal']) * 100) . '%';
- } else {
- $this->data['proArray'][$key]['pcurrdone'] = '0%';
- }
- $this->data['proArray'][$key]['bcontracttotal'] = number_format($this->data['proArray'][$key]['contracttotal'], 2, '.', ',');
- $this->data['proArray'][$key]['bchangTotal'] = number_format($this->data['proArray'][$key]['changTotal'], 2, '.', ',');
- $this->data['proArray'][$key]['index'] = $key%8+1;
- }
- } else {
- $this->data['proArray'] = array();
- }
- $this->render('r-project', $this->data);
- }
- public function proOverview()
- {
- // $this->data['pros'] = $this->project->getAll();
- // if (isset($_POST['pname']) && $_POST['pname']) {
- // $this->project->insertProject($_POST['pname']);
- // return Doo::conf()->APP_URL . 'project/index';
- // }
- $this->data['pid'] = $this->params['pid'];
- $this->render('w-project-detail', $this->data);
- }
- public function proSection()
- {
- $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());
- foreach ($auditArray as $key => $value) {
- $pmidArray[] = $value['pmid'];
- }
- foreach ($this->data['conArray'] as $key => $value) {
- $html = null;
- $hetongTotal = $dispstopnowtotal = $dispnowtotal = $countNum = 0;
- $nstopnowtotal = $ncurrdone = $nnowtotal = number_format(0, 2, '.', ',');
- $pstopnowtotal = '0%';
- $pcurrdone = '0%';
- $ncurrdone = number_format(0, 2, '.', ',');
- $pnowtotal = '0%';
- $dispcurrdone = '0%';
- // $numStatusArray['currstatus'] = 'uncheck';
- $StidArray = $this->actmeasure->getAllbyStid($value['stid']);
- $currdoneInt = $this->numofperact->getCurrdoneSTID($value['stid'])['totalplus'];
- if (isset($StidArray))
- foreach ($StidArray as $k => $v) {
- if (in_array($v['pmid'], $pmidArray)) {
- $snTotal = $this->numofperact->getStopNowTotal($v['pmid']); //根据标段ID获取最新一期(包括不通过)
- $currcomTotal = $this->numofperact->getCurrdoneNew($v['pmid']); //截止目前
- $ncurrdone = number_format($currcomTotal['currtotal'], 2, '.', ',');
- $nstopnowtotal = number_format($snTotal['sntotal'], 2, '.', ',');
- if ($v['contracttotal'] > 0) {
- $nnowtotal = number_format($v['contracttotal'] - $currcomTotal['currtotal'] - $snTotal['sntotal'], 2, '.', ',');
- $pstopnowtotal = round(($snTotal['sntotal'] / $v['contracttotal']) * 100);
- $pcurrdone = round(($currcomTotal['currtotal'] / $v['contracttotal']) * 100);
- }
- $dispcurrdone = $pcurrdone . '%';
- $dispstopnowtotal = $pstopnowtotal . '%';
- $pnowtotal = 100 - $pcurrdone - $pstopnowtotal;
- $dispnowtotal = $pnowtotal . '%';
- $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-sm" 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="taR">¥' . number_format($v['contracttotal'], 2, '.', ',') . '</td>
- <td>
- <div class="progress">
- <div class="progress-bar progress-bar-success" style="width: ' . $dispstopnowtotal . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="截止上期完成:¥' . $nstopnowtotal . '">' . $dispstopnowtotal . '</div>
- <div class="progress-bar" style="width:' . $dispcurrdone . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="本期完成:¥' . $ncurrdone . '">' . $dispcurrdone . '</div>
- <div class="progress-bar progress-bar-gary" style="width:' . $dispnowtotal . ';" data-placement="bottom" data-toggle="tooltip" data-original-title="未完成:¥' . $nnowtotal . '">' . $dispnowtotal . '</div>
- </div>
- </td>
- </tr>';
- $hetongTotal += $v['contracttotal'];
- }
- }
- $this->data['conArray'][$key]['htmlstr'] = $html;
- $this->data['conArray'][$key]['hetongTotal'] = number_format($hetongTotal, 2, '.', ',');
- $this->data['conArray'][$key]['phetongTotal'] = 0;
- $this->data['conArray'][$key]['nhetongTotal'] = 0;
- $this->data['conArray'][$key]['phetongTotal2'] = 0;
- $this->data['conArray'][$key]['ncurrdoneInt'] = 0;
- $this->data['conArray'][$key]['phetongTotal'] = round(($currdoneInt / $hetongTotal) * 100) . '%';
- $this->data['conArray'][$key]['nhetongTotal'] = number_format($currdoneInt, 2, '.', ',');
- $this->data['conArray'][$key]['phetongTotal2'] = round((($hetongTotal - $currdoneInt) / $hetongTotal) * 100) . '%';
- $this->data['conArray'][$key]['ncurrdoneInt'] = number_format($hetongTotal - $currdoneInt, 2, '.', ',');
- }
- $this->render('r-project-section', $this->data, TRUE);
- }
- function proSectionMeasure()
- {
- $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'];
- $this->data['mastatus'] = $this->measureauditact->getStatusByMpid($this->params['mpid'])['mastatus'];
- if (isset($_POST['submit'])) {
- if ($_POST['submit'] == 'ok') {
- $this->measureauditact->setStatusTrue($this->params['mpid']);
- return Doo::conf()->APP_URL . 'rproject/' . $this->params['pid'] . '/section/' . $this->params['mpid'] . '/measure';
- }
- if ($_POST['submit'] == 'no') {
- $this->measureauditact->setStatusFalse($this->params['mpid']);
- return Doo::conf()->APP_URL . 'rproject/' . $this->params['pid'] . '/section/' . $this->params['mpid'] . '/measure';
- }
- }
- // $jsonpath = pathinfo($this->attfile->getMaxRow()['filepath']);
- // $extPathdir = Doo::conf()->SITE_PATH . $jsonpath['dirname'] . '/' . $jsonpath['filename'];
- // if ($handle = opendir($extPathdir)) {
- // while (false !== ($file = readdir($handle))) {
- // $filename = pathinfo($file);
- // if ($filename['extension'] == 'json')
- // $proArray = json_decode(file_get_contents($extPathdir . '/' . $file));
- // }
- // closedir($handle);
- // }
- // $this->data['proArray'] = $proArray;
- $this->render('r-project-section-measure', $this->data, TRUE);
- }
- function proSectionFiles()
- {
- if (isset($_POST['optype']) && ($_POST['optype'] == 'replace') && ($_POST['imnid'])) {
- $imnidArray = $this->itemmeasurenum->getRowData($_POST['imnid']);
- if ($imnidArray['iaid'] > 0) {
- $fileArray = $this->upItemFile('file')[0];
- if (isset($fileArray['filepath'])) {
- $itemArray = $this->itemfle->getItemFile($imnidArray['iaid']);
- if (isset($itemArray)) {
- if ($itemArray['oldiaid'] > 0) {
- $oldiaid = $itemArray['oldiaid'];
- } else {
- $oldiaid = $imnidArray['iaid'];
- }
- $postArray = array('ownerid' => $this->auth->getUid(), 'pid' => $itemArray['pid'], 'pmid' => $itemArray['pmid'], 'filename' => $fileArray['filename'], 'filesize' => $fileArray['filesize'], 'fileext' => $fileArray['fileext'], 'filepath' => $fileArray['filepath'], 'oldiaid' => $oldiaid);
- $iaid = $this->itemfle->insertItemFileRecord($postArray);
- if ($iaid > 1) {
- $this->itemmeasurenum->updateIAID($imnidArray['iaid'], $iaid);
- echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
- die();
- }
- }
- }
- }
- }
- if (isset($_POST['optype']) && ($_POST['optype'] == 'del') && isset($_POST['imnid'])) {
- $imnidArray = $this->itemmeasurenum->getRowData($_POST['imnid']);
- if ($imnidArray['iaid'] > 0) {
- $this->itemmeasurenum->updateDeltag($_POST['imnid'], $this->auth->getUid());
- echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
- die();
- }
- }
- if (isset($_POST['filename']) && isset($_POST['filedesc']) && isset($_POST['upimnid'])) {
- $filename = $_POST['filename'];
- $filedesc = $_POST['filedesc'];
- $imnidArray = $this->itemmeasurenum->getRowData($_POST['upimnid']);
- if ($imnidArray['iaid'] > 0) {
- if (isset($filename))
- $this->itemfle->updateItemFields($imnidArray['iaid'], $filename, 0);
- if (isset($filedesc))
- $this->itemmeasurenum->updateItemFields($_POST['upimnid'], $filedesc, 0);
- echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
- die();
- }
- }
- $numStatusArray = $this->numofperact->getLastStatus3($this->params['pid'], $this->params['pmid']);
- if (!isset($numStatusArray['currstatus'])) {
- $numStatusArray['currstatus'] = 'uncheck';
- }
- // 面包屑导航项目
- $this->data['currproArray'] = $this->data['allproArray'] = NULL;
- $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']);
- // 面包屑导航合同
- $conArray = $this->contractact->getAll();
- $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
- if (isset($measureArray['stid'])) {
- foreach ($conArray as $kkk => $vvv) {
- if ($vvv['stid'] == $measureArray['stid']) {
- $this->data['currconArray'] = $vvv;
- } else {
- if ($vvv['pid'] == $this->params['pid'])
- $this->data['allconArray'][] = $vvv;
- }
- }
- } else {
- $this->data['currconArray'] = $this->data['allconArray'] = NULL;
- }
- // 面包屑导航标段
- $this->data['curractmeasureArray'] = NULL;
- $this->data['allactmeasureArray'] = [];
- $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;
- }
- }
- }
- // 选取查询
- $groupArray = $this->numofperact->getGroupByLastOne2($this->params['pmid']);
- $this->data['groupArray'] = $groupArray;
- $owneridArray = $this->itemfle->getGroupOwnerid($this->params['pmid']);
- foreach ($owneridArray as $k => $v) {
- $this->data['owneridArray'][$k]['name'] = $this->profile->getProWithUid($v['ownerid'])['name'];
- $this->data['owneridArray'][$k]['iaid'] = $v['iaid'];
- $this->data['owneridArray'][$k]['ownerid'] = $v['ownerid'];
- }
- // 分页
- $totalArchive = $this->itemmeasurenum->getCount($this->params['pmid'], 0, $this->params['numpname'], $this->params['userid']);
- if ($totalArchive) {
- if ($this->params['numpname'] && $this->params['userid']) {
- $pager = new DooPager(Doo::conf()->APP_URL . 'rproject/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/num/' . $this->params['numpname'] . '/user/' . $this->params['userid'] . '/page', $totalArchive, 20, 100);
- } elseif ($this->params['numpname']) {
- $pager = new DooPager(Doo::conf()->APP_URL . 'rproject/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/num/' . $this->params['numpname'] . '/page', $totalArchive, 20, 100);
- } elseif ($this->params['userid']) {
- $pager = new DooPager(Doo::conf()->APP_URL . 'rproject/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/user/' . $this->params['userid'] . '/page', $totalArchive, 20, 100);
- } else {
- $pager = new DooPager(Doo::conf()->APP_URL . 'rproject/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/page', $totalArchive, 20, 100);
- }
- $pager->setCss('', 'disabled', 'active');
- if (isset($this->params['pindex']))
- $pager->paginate(intval($this->params['pindex']));
- else
- $pager->paginate(1);
- $this->data['itemMeasureArray'] = $this->itemmeasurenum->getItemMeasureNum($this->params['pmid'], $pager->limit, $this->params['numpname'], $this->params['userid']);
- }
- foreach ($this->data['itemMeasureArray'] as $k => $v) {
- $fileArray = $this->itemfle->getItemFile($v['iaid']);
- $this->data['itemMeasureArray'][$k]['realname'] = $this->profile->getProWithUid($v['ownerid'])['name'];
- $this->data['itemMeasureArray'][$k]['pmname'] = $this->actmeasure->getRowByPmid($v['pmid'])['pmname'];
- $this->data['itemMeasureArray'][$k]['filename'] = $fileArray['filename'];
- $this->data['itemMeasureArray'][$k]['fileext'] = $fileArray['fileext'];
- $this->data['itemMeasureArray'][$k]['tips'] = $v['tips'];
- }
- $this->data['pid'] = $this->params['pid'];
- $this->data['pmid'] = $this->params['pmid'];
- $this->data['mpid'] = $numStatusArray['mpid'];
- $this->data['userid'] = $this->params['userid'];
- $this->data['num'] = $this->params['numpname'];
- $this->data['pager'] = $pager->output;
- $this->render('r-project-section-files', $this->data, TRUE);
- }
- function proSectionFilesRecover()
- {
- if (isset($_POST['optype']) && ($_POST['optype'] == 'reconvery') && isset($_POST['imnid'])) {
- $imnidArray = $this->itemmeasurenum->getRowData($_POST['imnid']);
- if ($imnidArray['iaid'] > 0) {
- $this->itemmeasurenum->recoveryDel($_POST['imnid']);
- echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
- die();
- }
- }
- if (isset($_POST['optype']) && ($_POST['optype'] == 'del') && isset($_POST['imnid'])) {
- $imnidArray = $this->itemmeasurenum->getRowData($_POST['imnid']);
- if ($imnidArray['iaid'] > 0) {
- $iaidArray = $this->itemfle->getItemFile($imnidArray['iaid']);
- if ($iaidArray['ownerid'] == $this->auth->getUid()) {
- $this->itemfle->delItem($imnidArray['iaid']);
- $this->itemmeasurenum->delItemIAID($imnidArray['iaid']);
- echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
- die();
- } else {
- echo json_encode(array('status' => 2), JSON_UNESCAPED_UNICODE);
- die();
- }
- }
- }
- // 面包屑导航项目
- $this->data['currproArray'] = $this->data['allproArray'] = NULL;
- $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']);
- // 面包屑导航合同
- $conArray = $this->contractact->getAll();
- $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
- if (isset($measureArray['stid'])) {
- foreach ($conArray as $kkk => $vvv) {
- if ($vvv['stid'] == $measureArray['stid']) {
- $this->data['currconArray'] = $vvv;
- } else {
- if ($vvv['pid'] == $this->params['pid'])
- $this->data['allconArray'][] = $vvv;
- }
- }
- } else {
- $this->data['currconArray'] = $this->data['allconArray'] = NULL;
- }
- // 面包屑导航标段
- $this->data['curractmeasureArray'] = NULL;
- $this->data['allactmeasureArray'] = [];
- $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;
- }
- }
- }
- $totalArchive = $this->itemmeasurenum->getCount($this->params['pmid']);
- if ($totalArchive) {
- $pager = new DooPager(Doo::conf()->APP_URL . 'rproject/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/recover/page', $totalArchive, 20, 100);
- $pager->setCss('', 'disabled', 'active');
- if (isset($this->params['pindex']))
- $pager->paginate(intval($this->params['pindex']));
- else
- $pager->paginate(1);
- $this->data['itemMeasureArray'] = $this->itemmeasurenum->getItemMeasureNumDel($pager->limit, $this->params['pmid']);
- }
- foreach ($this->data['itemMeasureArray'] as $k => $v) {
- $fileArray = $this->itemfle->getItemFile($v['iaid']);
- $this->data['itemMeasureArray'][$k]['realname'] = $this->profile->getProWithUid($v['ownerid'])['name'];
- $this->data['itemMeasureArray'][$k]['delname'] = $this->profile->getProWithUid($v['deluid'])['name'];
- $this->data['itemMeasureArray'][$k]['pmname'] = $this->actmeasure->getRowByPmid($v['pmid'])['pmname'];
- $this->data['itemMeasureArray'][$k]['filename'] = $fileArray['filename'];
- $this->data['itemMeasureArray'][$k]['fileext'] = $fileArray['fileext'];
- $this->data['itemMeasureArray'][$k]['tips'] = $v['tips'];
- $this->data['itemMeasureArray'][$k]['filepath'] = $fileArray['filepath'];
- }
- $this->data['pid'] = $this->params['pid'];
- $this->data['pmid'] = $this->params['pmid'];
- $this->data['mpid'] = $this->params['mpid'];
- $this->data['pager'] = $pager->output;
- $this->render('r-project-section-files-recover', $this->data, TRUE);
- }
- /**
- * @return actMeasure
- */
- public function proSectionGetFiles()
- {
- $attaArray = $this->itemfile->getItemFile($this->params['iaid']);
- $this->file_down($attaArray['filepath'], $attaArray['filesize'], $attaArray['filename'] . '.' . $attaArray['fileext']);
- return;
- }
- /**
- * 文件下载
- * @param $filepath 文件路径
- * @param $filename 文件名称
- */
- function file_down($filepath, $filesize, $filename = '')
- {
- if (!$filename)
- $filename = basename($filepath);
- if ($this->is_ie())
- $filename = rawurlencode($filename);
- $filetype = $this->fileext($filename);
- // $filesize = sprintf("%u", filesize($filepath));
- if (ob_get_length() !== false)
- @ob_end_clean();
- header('Pragma: public');
- header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
- header('Cache-Control: no-store, no-cache, must-revalidate');
- header('Cache-Control: pre-check=0, post-check=0, max-age=0');
- header('Content-Transfer-Encoding: binary');
- header('Content-Encoding: none');
- header('Content-type: ' . $filetype);
- header('Content-Disposition: attachment; filename="' . $filename . '"');
- header('Content-length: ' . $filesize);
- @readfile($filepath);
- exit;
- }
- /**
- * IE浏览器判断
- */
- function is_ie()
- {
- $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
- if ((strpos($useragent, 'opera') !== false) || (strpos($useragent, 'konqueror') !== false))
- return false;
- if (strpos($useragent, 'msie ') !== false)
- return true;
- return false;
- }
- /**
- * 取得文件扩展
- *
- * @param $filename 文件名
- * @return 扩展名
- */
- function fileext($filename)
- {
- return strtolower(trim(substr(strrchr($filename, '.'), 1, 10)));
- }
- Function fNumber($number)
- {
- if ($number == '')
- Return "-";
- $nlen = strlen($number);
- while ($nlen > 3) {
- $fNumber = "," . substr($number, $nlen - 3, 3);
- $number = substr($number, 0, -3);
- $nlen = strlen($number);
- }
- if ($nlen <= 3) {
- $fNumber = $number . $fNumber;
- }
- Return $fNumber;
- }
- public function welcome()
- {
- // if (!$this->auth->isLoggedIn())
- // return Doo::conf()->APP_URL;
- if ($this->profile->getProWithUid($_SESSION['uid'])['userid'])
- return Doo::conf()->APP_URL . 'project/list';
- if (isset($_POST['welform'])) {
- $profileUserArray = $_POST;
- $profileUserArray['userid'] = $_SESSION['uid'];
- $this->profile->insertProfile($profileUserArray); // 无自增字段返回0
- return Doo::conf()->APP_URL . 'project/list';
- }
- $this->render('welcome', $this->data);
- }
- public function prolist()
- {
- // if (!$this->auth->isLoggedIn())
- // return Doo::conf()->APP_URL;
- // $proArray = new stdClass();
- // $jsonpath = pathinfo($this->attfile->getMaxRow()['filepath']);
- // $extPathdir = Doo::conf()->SITE_PATH . $jsonpath['dirname'] . '/' . $jsonpath['filename'];
- // if ($handle = opendir($extPathdir)) {
- // while (false !== ($file = readdir($handle))) {
- // $filename = pathinfo($file);
- // if ($filename['extension'] == 'json')
- // $proArray = json_decode(file_get_contents($extPathdir . '/' . $file));
- // }
- // closedir($handle);
- // }
- // $this->data['proArray'] = null;
- $this->render('s-project', $this->data);
- }
- public function proDetail()
- {
- $numStatusArray = $this->numofperact->getLastStatus3($this->params['pid'], $this->params['pmid']);
- if (!isset($numStatusArray['currstatus'])) {
- $numStatusArray['currstatus'] = 'uncheck';
- }
- // 面包屑导航项目
- $this->data['currproArray'] = $this->data['allproArray'] = NULL;
- $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']);
- // 面包屑导航合同
- $conArray = $this->contractact->getAll();
- $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
- if (isset($measureArray['stid'])) {
- foreach ($conArray as $kkk => $vvv) {
- if ($vvv['stid'] == $measureArray['stid']) {
- $this->data['currconArray'] = $vvv;
- } else {
- if ($vvv['pid'] == $this->params['pid'])
- $this->data['allconArray'][] = $vvv;
- }
- }
- } else {
- $this->data['currconArray'] = $this->data['allconArray'] = NULL;
- }
- // 面包屑导航标段
- $this->data['curractmeasureArray'] = NULL;
- $this->data['allactmeasureArray'] = [];
- $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;
- }
- }
- }
- $this->data['MeasureArray'] = $this->numofperact->getGroupByLastOne($this->params['pmid']);
- // $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
- foreach ($this->data['MeasureArray'] as $key => $value) {
- if ($measureArray['contracttotal'] > $value['currdone'] && $value['currdone'] > 0) {
- $this->data['MeasureArray'][$key]['lessTotal'] = round(($value['currdone'] / $measureArray['contracttotal']) * 100);
- } else {
- $this->data['MeasureArray'][$key]['lessTotal'] = 0;
- }
- }
- $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()
- {
- // 面包屑导航项目
- $this->data['currproArray'] = $this->data['allproArray'] = NULL;
- $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']);
- // 面包屑导航合同
- $conArray = $this->contractact->getAll();
- $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
- if (isset($measureArray['stid'])) {
- foreach ($conArray as $kkk => $vvv) {
- if ($vvv['stid'] == $measureArray['stid']) {
- $this->data['currconArray'] = $vvv;
- } else {
- if ($vvv['pid'] == $this->params['pid'])
- $this->data['allconArray'][] = $vvv;
- }
- }
- } else {
- $this->data['currconArray'] = $this->data['allconArray'] = NULL;
- }
- // 面包屑导航标段
- $this->data['curractmeasureArray'] = NULL;
- $this->data['allactmeasureArray'] = [];
- $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;
- }
- }
- }
- // 期数列表
- $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']);
- $maxtimez = $this->numofperact->getRowByMpid($this->params['mpid']);
- $auditUserArray = $this->measureauditact->getRowByMpidTimes($this->params['mpid'], $maxtimez['numpname'], $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']);
- // SMS Start
- $TenderArray = $this->actmeasure->getRowByPmid($lastRowArray['pmid']);
- $userProArray = $this->profile->getProWithUid($TenderArray['uid']);
- if (isset($userProArray) && ($userProArray['mobile'])) {
- $retval = $this->__auditNotice($userProArray['mobile'], Doo::conf()->SMS_TIPS_PRE . '您好,' . $TenderArray["pmname"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR3"]);
- }
- // SMS End
- 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']);
- // SMS Start
- $verifyUserArray = $this->profile->getVerifiedMobile($auditUserArray[1]['auditoruid']);
- $pmnameArray = $this->actmeasure->getRowByPmid($lastRowArray['pmid']);
- if (isset($verifyUserArray) && ($verifyUserArray['mobile'])) {// XXXX(标段名),陈特,已审批通过。请您继续审批。
- $this->__auditNotice($verifyUserArray['mobile'], Doo::conf()->SMS_TIPS_PRE . '您好,' . $pmnameArray["pmname"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR2"]);
- }
- // SMS End
- 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']);
- // SMS Start
- $verifyUserArray = $this->profile->getVerifiedMobile($auditUserArray[0]['auditoruid']);
- // var_dump($verifyUserArray);
- $pmnameArray = $this->actmeasure->getRowByPmid($auditUserArray[0]['pmid']);
- // var_dump($pmnameArray);
- // SMS End
- } else {
- $this->measureauditact->updateMastatus($auditUserArray[$k + 1]['maid']);
- // SMS Start
- $verifyUserArray = $this->profile->getVerifiedMobile($auditUserArray[$k + 1]['auditoruid']);
- // var_dump($verifyUserArray);
- $pmnameArray = $this->actmeasure->getRowByPmid($auditUserArray[$k + 1]['pmid']);
- // var_dump($pmnameArray);
- // SMS End
- }
- // SMS Start
- if (isset($verifyUserArray) && ($verifyUserArray['mobile'])) {// XXXX(标段名),陈特,已审批通过。请您继续审批。
- // $retval = $this->__auditNotice($verifyUserArray['mobile'], Doo::conf()->SMS_TIPS_PRE . $pmnameArray["pmname"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR2"]);
- $this->__auditNotice($verifyUserArray['mobile'], Doo::conf()->SMS_TIPS_PRE . '您好,' . $pmnameArray["pmname"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR2"]);
- // var_dump($pmnameArray["pmname"] . Doo::conf()->SMS_TIPS["AUDIT_NOTICE_AUDITOR2"]);
- // var_dump($retval);
- // var_dump($this->sms->getErrors());
- }
- // SMS End
- $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']);
- // SMS Start
- $TenderArray = $this->actmeasure->getRowByPmid($lastRowArray['pmid']);
- $userProArray = $this->profile->getProWithUid($TenderArray['uid']);
- 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"]);
- // var_dump($retval);
- // var_dump($this->sms->getErrors());
- // $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'];
- 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'];
- }
- $strAvatar = $this->auth->getAvatar($measureArray['uid']);
- $orginArray['avatar'] = '<img src="' . $strAvatar . '"></li>';
- $orginArray['name'] = $this->profile->getProWithUid($measureArray['uid'])['name'];
- $attfileArray = $this->attfile->getFirstFile($lastRowArray['pmid'], $lastRowArray['numpname'], $lastRowArray['times']);
- $orginArray['time'] = date('Y-m-d', $attfileArray['intime']);
- $this->data['auditArray'] = $auditUserArray;
- $this->data['orginArray'] = $orginArray;
- $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);
- }
- /**
- * 。
- * 标段ID,期号
- */
- private function __auditNotice($mobile, $text)
- {
- $smsSwitch = $this->aconfig->getOne(array('select' => 'smsSwitch', 'asArray' => TRUE))['smsSwitch'];
- if ($smsSwitch > 0)
- return $this->sms->sendSms($mobile, $text);
- }
- /*
- *
- * 中间计量表草图列表
- */
- public function proSectionInterMediate(){
- //草图功能开关控制
- if($this->data['imediateSwitch'] == 0){
- exit('中间计量表草图添加功能未启用...');
- }
- // 面包屑导航项目
- $this->data['currproArray'] = $this->data['allproArray'] = NULL;
- $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']);
- // 面包屑导航合同
- $conArray = $this->contractact->getAll();
- $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
- if (isset($measureArray['stid'])) {
- foreach ($conArray as $kkk => $vvv) {
- if ($vvv['stid'] == $measureArray['stid']) {
- $this->data['currconArray'] = $vvv;
- } else {
- if ($vvv['pid'] == $this->params['pid'])
- $this->data['allconArray'][] = $vvv;
- }
- }
- } else {
- $this->data['currconArray'] = $this->data['allconArray'] = NULL;
- }
- // 面包屑导航标段
- $this->data['curractmeasureArray'] = NULL;
- $this->data['allactmeasureArray'] = [];
- $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;
- }
- }
- }
- Doo::loadHelper('DooPager');
- $pagestr = '';
- $sqlstr = ' 1';
- $this->data['phaseno'] = '';
- $this->data['nosign'] = '';
- //获取项目信息
- $searchsql = 'isinter=3';
- if(isset($this->params['pid']) && is_numeric($this->params['pid'])){
- $pagestr .= '/'.$this->params['pid'];
- $sqlstr .= ' and project='.$this->params['pid'];
- //获取标段信息
- if(isset($this->params['pmid']) && is_numeric($this->params['pmid'])){
- $pagestr .= '/section/'.$this->params['pmid'];
- $sqlstr .= ' and tender='.$this->params['pmid'];
- //获取期数信息
- $phasenolist = $this->sign->getSignGroupByPhaseno($this->params['pmid'],$searchsql);
- if(!empty($phasenolist)){
- foreach($phasenolist as $pk => $pv){
- $phasenolist[$pk]['numpname'] = $pv['phaseno'];
- }
- }
- if(isset($this->params['mpid']) && is_numeric($this->params['mpid'])){
- $this->data['phaseno'] = $this->params['mpid'];
- $pagestr .= '/phaseno/'.$this->params['mpid'];
- $sqlstr .= ' and phaseno='.$this->params['mpid'];
- }
- }
- }
- $totalArchive = $this->sign->getSignNum($sqlstr.' and '.$searchsql);
- $pager = new DooPager(Doo::conf()->APP_URL . 'rproject'.$pagestr.'/intermediate/page', $totalArchive, 10, 100);
- $pager->setCss('', 'disabled', 'active');
- if (isset($this->params['pindex']))
- $pager->paginate(intval($this->params['pindex']));
- else
- $pager->paginate(1);
- if ($pager->limit != ' -10,10')
- $list = $this->sign->getSignList($sqlstr.' and '.$searchsql,$pager->limit);
- if(isset($list) && !empty($list)){
- foreach($list as $k => $v){
- //获取项目名,标段名,标段期数
- $project = $this->project->getRowByPid($v['project']);
- $tender = $this->actmeasure->getRowByPmid($v['tender']);
- // $phaseno = $this->numofperact->getCurrStatus($v['phaseno']);
- $list[$k]['project'] = $project['pname'];
- $list[$k]['tender'] = $tender['pmname'];
- // $list[$k]['phaseno'] = $phaseno['numpname'];
- $list[$k]['ownname'] = $this->auth->getName($v['ownuid']);
- $list[$k]['auditname'] = $this->auth->getName($v['audituid']);
- }
- }
- $this->data['list'] = isset($list) ? $list : '';
- $this->data['phasenolist'] = isset($phasenolist) ? $phasenolist : '';
- $this->data['pager'] = $pager->output;
- $numStatusArray = $this->numofperact->getLastStatus3($this->params['pid'], $this->params['pmid']);
- if (!isset($numStatusArray['currstatus'])) {
- $numStatusArray['currstatus'] = 'uncheck';
- }
- $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);
- }
- /**
- *
- * 中间计量表视图
- */
- public function signView()
- {
- //草图功能开关控制
- if($this->data['imediateSwitch'] == 0){
- exit('中间计量表草图添加功能未启用...');die;
- }
- if(!isset($this->params['sid']) || !is_numeric($this->params['sid'])){
- exit('没有报表参数');
- }
- //获取报表信息
- $signmsg = $this->sign->getOneSignbysid($this->params['sid']);
- if(empty($signmsg) || $signmsg['isinter'] != 3){
- exit('不存在此中间计量表');
- }
- $backurl = '/rproject/'.$signmsg['project'].'/section/'.$signmsg['tender'].'/intermediate';
- //获取项目名,标段名,标段期数
- $project = $this->project->getRowByPid($signmsg['project']);
- $tender = $this->actmeasure->getRowByPmid($signmsg['tender']);
- // $phaseno = $this->numofperact->getCurrStatus($signmsg['phaseno']);
- $signmsg['project'] = $project['pname'];
- $signmsg['tender'] = $tender['pmname'];
- // $signmsg['phaseno'] = $phaseno['numpname'];
- //获取签署人列表
- $signauditlist = $this->sign->getSignAuditList($this->params['sid']);
- if(!empty($signauditlist)){
- foreach($signauditlist as $k => $v){
- //获取签署人头像
- $signauditlist[$k]['index'] = $k+1;
- $signauditlist[$k]['avatar'] = $this->auth->getAvatar($v['audituid']);
- }
- }
- //获取报表图片
- $maxwidth = 794; //默认图片最大宽度 a4
- $maxheight = 1123; //默认图片最大高度 a4
- if(!empty($signmsg['widhei'])){
- $widhei = explode('_', $signmsg['widhei']);
- $style = $widhei[0].'mm '.$widhei[1].'mm';
- }else{
- $style = '210mm 297mm';
- }
- $signattlist = $this->sign->getSignAttList($this->params['sid']);
- if(!empty($signattlist)){
- foreach($signattlist as $sak => $sav){
- $signattlist[$sak]['auditatt'] = $this->sign->getSignAuditAttList($sav['said']);
- if($sak == 0){
- $imgmsg = getimagesize(Doo::conf()->APP_URL.$sav['filepath']);
- $maxwidth = $imgmsg[0];
- $maxheight = $imgmsg[1];
- }
- }
- }
- $this->data['signmsg'] = $signmsg;
- $this->data['auditlist'] = $signauditlist;
- $this->data['attlist'] = $signattlist;
- $this->data['backurl'] = $backurl;
- $this->data['maxwidth'] = $maxwidth;
- $this->data['maxheight'] = $maxheight;
- $this->data['style'] = $style;
- $this->render('sign-view-page', $this->data, TRUE);
- }
- }
- ?>
|