|  | @@ -261,6 +261,7 @@ class ChangeController extends DooController
 | 
	
		
			
				|  |  |          $this->data['status'] = $status;
 | 
	
		
			
				|  |  |          $this->data['prolist'] = $prolist;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        $sql .= ' and cid in (SELECT `jl_change_audit`.cid FROM `jl_change_audit` WHERE `jl_change_audit`.uid='.$this->auth->getUid().' GROUP BY `jl_change_audit`.cid)';
 | 
	
		
			
				|  |  |          $this->data['num1'] = $this->change->getNumbyMydetail($pmid,$this->auth->getUid());
 | 
	
		
			
				|  |  |          $this->data['num2'] = $this->change->getNumbystatus($pmid,'uncheck','back',$sql);
 | 
	
		
			
				|  |  |          $this->data['num3'] = $this->change->getNumbystatus($pmid,'checking','',$sql);
 | 
	
	
		
			
				|  | @@ -351,7 +352,7 @@ class ChangeController extends DooController
 | 
	
		
			
				|  |  |                      $stotalnum = 0;
 | 
	
		
			
				|  |  |                      $listtablehtml = '<table class="table table-striped table-bordered nowrap" id="tablelist" cellspacing="0" width="100%">
 | 
	
		
			
				|  |  |  								<thead>
 | 
	
		
			
				|  |  | -									<tr><th rowspan="2" class="text-center" width="100">清单编号</th><th rowspan="2" class="text-center">名称</th><th rowspan="2" class="text-center">单位</th><th rowspan="2" class="text-center">单价</th><th colspan="2" class="text-center">原设计</th><th colspan="2" class="text-center">申报变更</th>';
 | 
	
		
			
				|  |  | +									<tr><th rowspan="2" class="text-center" width="100">清单编号</th><th rowspan="2" class="text-center">名称</th><th rowspan="2" class="text-center">单位</th><th rowspan="2" class="text-center">单价</th><th colspan="2" class="text-center">原设计</th><th colspan="2" class="text-center">申报变更增(+)减(-)</th>';
 | 
	
		
			
				|  |  |                      $thhtml = '<th class="text-center">数量</th>
 | 
	
		
			
				|  |  |  									<th class="text-center">金额</th>
 | 
	
		
			
				|  |  |  									<th class="text-center">数量</th>
 | 
	
	
		
			
				|  | @@ -589,25 +590,45 @@ class ChangeController extends DooController
 | 
	
		
			
				|  |  |                      if(!empty($_POST['changelist'])){
 | 
	
		
			
				|  |  |                          $clist = explode(',',$_POST['changelist']);
 | 
	
		
			
				|  |  |                          foreach($clist as $ck => $cv){
 | 
	
		
			
				|  |  | -                            $clistarr = explode('_',$cv);
 | 
	
		
			
				|  |  | -                            if(is_numeric($clistarr[1])){
 | 
	
		
			
				|  |  | -                                $changelistArr = $this->change->getChangeListbyid($clistarr[0]);
 | 
	
		
			
				|  |  | -                                $total += todecimal(floatval($changelistArr['unitprice'])*floatval($clistarr[1]),$decimalnum['costdnum']);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                                $cauditlist = new ChangeAuditList();
 | 
	
		
			
				|  |  | -                                $cauditlist->pid = $pmArray['pid'];
 | 
	
		
			
				|  |  | -                                $cauditlist->stid = $pmArray['stid'];
 | 
	
		
			
				|  |  | -                                $cauditlist->pmid = $pmArray['pmid'];
 | 
	
		
			
				|  |  | -                                $cauditlist->cid = $cid;
 | 
	
		
			
				|  |  | -                                $cauditlist->lid = $clistarr[0];
 | 
	
		
			
				|  |  | -                                $cauditlist->lnum = $changelistArr['lnum'];
 | 
	
		
			
				|  |  | -                                $cauditlist->lname = $changelistArr['lname'];
 | 
	
		
			
				|  |  | -                                $cauditlist->unit = $changelistArr['unit'];
 | 
	
		
			
				|  |  | -                                $cauditlist->unitprice = $changelistArr['unitprice'];
 | 
	
		
			
				|  |  | -                                $cauditlist->oamount = $changelistArr['amount'];
 | 
	
		
			
				|  |  | -                                $cauditlist->camount = $clistarr[1];
 | 
	
		
			
				|  |  | -                                $cauditlist->auditjson = json_encode($auditArr);
 | 
	
		
			
				|  |  | -                                $cauditlist->insert();
 | 
	
		
			
				|  |  | +                            $clistid = explode('->',$cv)[0];
 | 
	
		
			
				|  |  | +                            $clistarr = explode(';',explode('->',$cv)[1]);
 | 
	
		
			
				|  |  | +                            if(!empty($clistarr[0]) && !empty($clistarr[1]) && is_numeric($clistarr[3]) && is_numeric($clistarr[4]) && is_numeric($clistarr[5])){
 | 
	
		
			
				|  |  | +                                $changelistArr = $this->change->getChangeListbyid($clistid);
 | 
	
		
			
				|  |  | +                                if(!empty($changelistArr)){
 | 
	
		
			
				|  |  | +                                    $total += todecimal(floatval($changelistArr['unitprice'])*floatval($clistarr[5]),$decimalnum['costdnum']);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                    $cauditlist = new ChangeAuditList();
 | 
	
		
			
				|  |  | +                                    $cauditlist->pid = $pmArray['pid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->stid = $pmArray['stid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->pmid = $pmArray['pmid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->cid = $cid;
 | 
	
		
			
				|  |  | +                                    $cauditlist->lid = $clistid;
 | 
	
		
			
				|  |  | +                                    $cauditlist->lnum = $changelistArr['lnum'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->lname = $changelistArr['lname'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->unit = $changelistArr['unit'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->unitprice = $changelistArr['unitprice'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->oamount = $changelistArr['amount'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->camount = $clistarr[5];
 | 
	
		
			
				|  |  | +                                    $cauditlist->auditjson = json_encode($auditArr);
 | 
	
		
			
				|  |  | +                                    $cauditlist->insert();
 | 
	
		
			
				|  |  | +                                }else{
 | 
	
		
			
				|  |  | +                                    $total += todecimal(floatval($clistarr[3])*floatval($clistarr[5]),$decimalnum['costdnum']);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                    $cauditlist = new ChangeAuditList();
 | 
	
		
			
				|  |  | +                                    $cauditlist->pid = $pmArray['pid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->stid = $pmArray['stid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->pmid = $pmArray['pmid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->cid = $cid;
 | 
	
		
			
				|  |  | +                                    $cauditlist->lid = 0;
 | 
	
		
			
				|  |  | +                                    $cauditlist->lnum = $clistarr[0];
 | 
	
		
			
				|  |  | +                                    $cauditlist->lname = $clistarr[1];
 | 
	
		
			
				|  |  | +                                    $cauditlist->unit = $clistarr[2];
 | 
	
		
			
				|  |  | +                                    $cauditlist->unitprice = $clistarr[3];
 | 
	
		
			
				|  |  | +                                    $cauditlist->oamount = $clistarr[4];
 | 
	
		
			
				|  |  | +                                    $cauditlist->camount = $clistarr[5];
 | 
	
		
			
				|  |  | +                                    $cauditlist->auditjson = json_encode($auditArr);
 | 
	
		
			
				|  |  | +                                    $cauditlist->insert();
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
	
		
			
				|  | @@ -959,7 +980,7 @@ class ChangeController extends DooController
 | 
	
		
			
				|  |  |                  $stotalnum = 0;
 | 
	
		
			
				|  |  |                  $listtablehtml = '<table class="table table-striped table-bordered nowrap" id="tablelist" cellspacing="0" width="100%">
 | 
	
		
			
				|  |  |  								<thead>
 | 
	
		
			
				|  |  | -									<tr><th rowspan="2" class="text-center" width="100">清单编号</th><th rowspan="2" class="text-center">名称</th><th rowspan="2" class="text-center">单位</th><th rowspan="2" class="text-center">单价</th><th colspan="2" class="text-center">原设计</th><th colspan="2" class="text-center">申报变更</th>';
 | 
	
		
			
				|  |  | +									<tr><th rowspan="2" class="text-center" width="100">清单编号</th><th rowspan="2" class="text-center">名称</th><th rowspan="2" class="text-center">单位</th><th rowspan="2" class="text-center">单价</th><th colspan="2" class="text-center">原设计</th><th colspan="2" class="text-center">申报变更增(+)减(-)</th>';
 | 
	
		
			
				|  |  |                  $thhtml = '<th class="text-center">数量</th>
 | 
	
		
			
				|  |  |  									<th class="text-center">金额</th>
 | 
	
		
			
				|  |  |  									<th class="text-center">数量</th>
 | 
	
	
		
			
				|  | @@ -1232,25 +1253,45 @@ class ChangeController extends DooController
 | 
	
		
			
				|  |  |                      if(!empty($_POST['changelist'])){
 | 
	
		
			
				|  |  |                          $clist = explode(',',$_POST['changelist']);
 | 
	
		
			
				|  |  |                          foreach($clist as $ck => $cv){
 | 
	
		
			
				|  |  | -                            $clistarr = explode('_',$cv);
 | 
	
		
			
				|  |  | -                            if(is_numeric($clistarr[1])){
 | 
	
		
			
				|  |  | -                                $changelistArr = $this->change->getChangeListbyid($clistarr[0]);
 | 
	
		
			
				|  |  | -                                $total += todecimal(floatval($changelistArr['unitprice'])*floatval($clistarr[1]),$decimalnum['costdnum']);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                                $cauditlist = new ChangeAuditList();
 | 
	
		
			
				|  |  | -                                $cauditlist->pid = $pmArray['pid'];
 | 
	
		
			
				|  |  | -                                $cauditlist->stid = $pmArray['stid'];
 | 
	
		
			
				|  |  | -                                $cauditlist->pmid = $pmArray['pmid'];
 | 
	
		
			
				|  |  | -                                $cauditlist->cid = $cid;
 | 
	
		
			
				|  |  | -                                $cauditlist->lid = $clistarr[0];
 | 
	
		
			
				|  |  | -                                $cauditlist->lnum = $changelistArr['lnum'];
 | 
	
		
			
				|  |  | -                                $cauditlist->lname = $changelistArr['lname'];
 | 
	
		
			
				|  |  | -                                $cauditlist->unit = $changelistArr['unit'];
 | 
	
		
			
				|  |  | -                                $cauditlist->unitprice = $changelistArr['unitprice'];
 | 
	
		
			
				|  |  | -                                $cauditlist->oamount = $changelistArr['amount'];
 | 
	
		
			
				|  |  | -                                $cauditlist->camount = $clistarr[1];
 | 
	
		
			
				|  |  | -                                $cauditlist->auditjson = json_encode($auditArr);
 | 
	
		
			
				|  |  | -                                $cauditlist->insert();
 | 
	
		
			
				|  |  | +                            $clistid = explode('->',$cv)[0];
 | 
	
		
			
				|  |  | +                            $clistarr = explode(';',explode('->',$cv)[1]);
 | 
	
		
			
				|  |  | +                            if(!empty($clistarr[0]) && !empty($clistarr[1]) && is_numeric($clistarr[3]) && is_numeric($clistarr[4]) && is_numeric($clistarr[5])){
 | 
	
		
			
				|  |  | +                                $changelistArr = $this->change->getChangeListbyid($clistid);
 | 
	
		
			
				|  |  | +                                if(!empty($changelistArr)){
 | 
	
		
			
				|  |  | +                                    $total += todecimal(floatval($changelistArr['unitprice'])*floatval($clistarr[5]),$decimalnum['costdnum']);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                    $cauditlist = new ChangeAuditList();
 | 
	
		
			
				|  |  | +                                    $cauditlist->pid = $pmArray['pid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->stid = $pmArray['stid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->pmid = $pmArray['pmid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->cid = $cid;
 | 
	
		
			
				|  |  | +                                    $cauditlist->lid = $clistid;
 | 
	
		
			
				|  |  | +                                    $cauditlist->lnum = $changelistArr['lnum'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->lname = $changelistArr['lname'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->unit = $changelistArr['unit'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->unitprice = $changelistArr['unitprice'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->oamount = $changelistArr['amount'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->camount = $clistarr[5];
 | 
	
		
			
				|  |  | +                                    $cauditlist->auditjson = json_encode($auditArr);
 | 
	
		
			
				|  |  | +                                    $cauditlist->insert();
 | 
	
		
			
				|  |  | +                                }else{
 | 
	
		
			
				|  |  | +                                    $total += todecimal(floatval($clistarr[3])*floatval($clistarr[5]),$decimalnum['costdnum']);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                    $cauditlist = new ChangeAuditList();
 | 
	
		
			
				|  |  | +                                    $cauditlist->pid = $pmArray['pid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->stid = $pmArray['stid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->pmid = $pmArray['pmid'];
 | 
	
		
			
				|  |  | +                                    $cauditlist->cid = $cid;
 | 
	
		
			
				|  |  | +                                    $cauditlist->lid = 0;
 | 
	
		
			
				|  |  | +                                    $cauditlist->lnum = $clistarr[0];
 | 
	
		
			
				|  |  | +                                    $cauditlist->lname = $clistarr[1];
 | 
	
		
			
				|  |  | +                                    $cauditlist->unit = $clistarr[2];
 | 
	
		
			
				|  |  | +                                    $cauditlist->unitprice = $clistarr[3];
 | 
	
		
			
				|  |  | +                                    $cauditlist->oamount = $clistarr[4];
 | 
	
		
			
				|  |  | +                                    $cauditlist->camount = $clistarr[5];
 | 
	
		
			
				|  |  | +                                    $cauditlist->auditjson = json_encode($auditArr);
 | 
	
		
			
				|  |  | +                                    $cauditlist->insert();
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
	
		
			
				|  | @@ -1359,7 +1400,7 @@ class ChangeController extends DooController
 | 
	
		
			
				|  |  |                      $addnum = 1;
 | 
	
		
			
				|  |  |                      foreach($clist as $ck => $cv){
 | 
	
		
			
				|  |  |                          $osum = floatval($cv['unitprice'])*floatval($cv['oamount']);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +                        $osum = todecimal($osum,2);
 | 
	
		
			
				|  |  |                          $csum = todecimal(floatval($cv['unitprice'])*floatval($cv['camount']),$decimalnum['costdnum']);
 | 
	
		
			
				|  |  |                          $clist[$ck]['csum'] = $csum;
 | 
	
		
			
				|  |  |                          $ctotalnum += $csum;
 | 
	
	
		
			
				|  | @@ -1367,11 +1408,9 @@ class ChangeController extends DooController
 | 
	
		
			
				|  |  |                          $oneclist = $this->change->getChangeListbyid($cv['lid']);
 | 
	
		
			
				|  |  |                          if($cv['lid'] != 0 && !empty($oneclist)){
 | 
	
		
			
				|  |  |                              array_push($changeidlist,$cv['lid']);
 | 
	
		
			
				|  |  | -                            array_push($changelist,$cv['lid'].'_'.$cv['camount']);
 | 
	
		
			
				|  |  | +                            array_push($changelist,$cv['lid'].'->'.$cv['lnum'].';'.$cv['lname'].';'.$cv['unit'].';'.$cv['unitprice'].';'.$cv['oamount'].';'.$cv['camount']);
 | 
	
		
			
				|  |  |                              $clist[$ck]['iswhite'] = 0;
 | 
	
		
			
				|  |  |                          }else{
 | 
	
		
			
				|  |  | -                            $osum = todecimal($osum,2);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                              $clist[$ck]['add'] = $addnum;
 | 
	
		
			
				|  |  |                              array_push($changewhitelist,$addnum.'->'.$cv['lnum'].';'.$cv['lname'].';'.$cv['unit'].';'.$cv['unitprice'].';'.$cv['oamount'].';'.$cv['camount']);
 | 
	
		
			
				|  |  |                              $addnum++;
 |