优化允许撤销汇总进行直接汇总

master
chenzhi 4 years ago
parent e10b27a067
commit d7b9a0ac1a

@ -710,16 +710,17 @@ class CompanyStatementController extends ThinkController
} }
foreach ($dbres as $k=>$v) { foreach ($dbres as $k=>$v) {
if($v['verify_status'] != 1) continue; if($v['verify_status'] == 1 || $v['verify_status'] == -2){
if($v['company_belong'] == 9){ if($v['company_belong'] == 9){
//上游 //上游
$this->setDf($datas['up'],$v); $this->setDf($datas['up'],$v);
} elseif($v['withdraw_type'] == 3&&$v['company_type']==1){ } elseif($v['withdraw_type'] == 3&&$v['company_type']==1){
$this->setDf($datas['complement_down'],$v); $this->setDf($datas['complement_down'],$v);
} elseif($v['withdraw_type'] == 3&&$v['company_type']==2){ } elseif($v['withdraw_type'] == 3&&$v['company_type']==2){
$this->setDf($datas['complement_user'],$v); $this->setDf($datas['complement_user'],$v);
} else { } else {
$this->setDf($datas['down'],$v); $this->setDf($datas['down'],$v);
}
} }
} }
@ -770,7 +771,7 @@ class CompanyStatementController extends ThinkController
M("company_lack_statement_info","tab_")->where("id in ({$v['del_lack_ids']})")->save(["is_pool"=>1]); M("company_lack_statement_info","tab_")->where("id in ({$v['del_lack_ids']})")->save(["is_pool"=>1]);
} }
//修改结算单规则 //修改结算单规则
$this->updatePoolVerifyStatus($v['statement_ids'],1,2,"pool",$v['statement_num']); $this->updatePoolVerifyStatus($v['statement_ids'],2,"pool",$v['statement_num']);
} }
$this->ajaxReturn(array( $this->ajaxReturn(array(
'status' => 1, 'status' => 1,
@ -778,10 +779,10 @@ class CompanyStatementController extends ThinkController
)); ));
} }
//结算单规则 //结算单规则
protected function updatePoolVerifyStatus($ids,$old_status,$change_status,$op_pre,$num){ protected function updatePoolVerifyStatus($ids,$change_status,$op_pre,$num){
$dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id in ({$ids})")->select(); $dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id in ({$ids})")->select();
foreach($dbres as $k=>&$v){ foreach($dbres as $k=>&$v){
if($v['verify_status'] != $old_status) continue; // if($v['verify_status'] != $old_status) continue;
$v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log'][$op_pre.'_user']=$this->admininfo["username"]; $v['verify_log'][$op_pre.'_user']=$this->admininfo["username"];
$v['verify_log'][$op_pre.'_time']=date("Y.m.d H:i:s"); $v['verify_log'][$op_pre.'_time']=date("Y.m.d H:i:s");

@ -475,8 +475,8 @@
}else if(id=="pool"){ }else if(id=="pool"){
var opname = "发起汇总"; var opname = "发起汇总";
var opurl = "{:U('pool')}"; var opurl = "{:U('pool')}";
var opst ="[审批通过]"; var opst ="[审批通过,汇总撤销]";
var status = [1]; var status = [1,-2];
}else if(id=="updateStatement"){ }else if(id=="updateStatement"){
var opname = "重算金额"; var opname = "重算金额";
var opurl = "{:U('updateStatement')}"; var opurl = "{:U('updateStatement')}";
@ -510,7 +510,7 @@
return; return;
} }
text = text.join(","); text = text.join(",");
console.log(text);
if(flag){ if(flag){
layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,点击取消停止操作",{title:false}, function(index){ layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,点击取消停止操作",{title:false}, function(index){
layer.close(index); layer.close(index);

Loading…
Cancel
Save