|
@@ -352,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>
|
|
@@ -590,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();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -960,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>
|
|
@@ -1233,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();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1368,7 +1408,7 @@ 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{
|
|
|
$clist[$ck]['add'] = $addnum;
|