diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php
index 4bfb3d8b8..a1fbdf569 100644
--- a/Application/Admin/Controller/CompanyStatementController.class.php
+++ b/Application/Admin/Controller/CompanyStatementController.class.php
@@ -19,13 +19,18 @@ class CompanyStatementController extends ThinkController
"9"=>"上游"
];
public $VerifyStatus=[
- "-2"=>"汇总撤销",
- "-1"=>"审批拒绝",
+ "-3"=>"汇总撤销",
+ "-2"=>"审核拒绝",
+ "-1"=>"管理员审批拒绝",
"0"=>"未审批",
- "1"=>"审核通过",
- "2"=>"对外发起",
- "3"=>"合作确认",
- "4"=>"已汇总"
+ "1"=>"管理员审核通过",
+ "2"=>"审核通过",
+ "3"=>"已汇总"
+ ];
+ public $ConfirmStatus=[
+ "0"=>"未发起",
+ "1"=>"已发起",
+ "2"=>"已确认"
];
public $admininfo;
public $DBModel;
@@ -112,12 +117,15 @@ class CompanyStatementController extends ThinkController
if(isset($_REQUEST['verify_status'])){
$map['verify_status'] = $_REQUEST['verify_status'];
}
+ if(isset($_REQUEST['confirm_status'])){
+ $map['confirm_status'] = $_REQUEST['confirm_status'];
+ }
// $this->checkListOrCountAuthRestMap($map);//导出权限
//条件end
$data = M("company_statement","tab_")
- ->field("id,withdraw_type,company_name,company_belong,statement_begin_time,statement_end_time,statement_money,platform_amount,verify_status,verify_log,op_time,remark")
+ ->field("id,withdraw_type,company_name,company_belong,statement_begin_time,statement_end_time,statement_money,platform_amount,verify_status,verify_log,confirm_status,confirm_log,op_time,remark")
->where($map)
- ->order("FIELD(verify_status,0,1,-1,2,3,-2,4,5),id desc")->page($page,$row)->select();
+ ->order("FIELD(verify_status,0,1,-1,2,3,-2,-3),id desc")->page($page,$row)->select();
foreach($data as $k => &$v) {
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
@@ -132,14 +140,26 @@ class CompanyStatementController extends ThinkController
$v['withdraw_type_2'] = ($v['withdraw_type'] == 2 ? "补点" :"正常结算");
$v['verify_log'] = json_decode($v['verify_log'], true);
+ $v['confirm_log'] = json_decode($v['confirm_log'], true);
if (isset($params['export'])) {
$symbol = "\n";
} else {
$symbol = "
";
}
$v["create"]= "{$v['verify_log']['create_user']} {$symbol} {$v['verify_log']['create_time']}";
- if(isset($v['verify_log']['verify_user'])){
+ if(isset($v['verify_log']['admin_user'])){
if($v['verify_status'] == -1){
+ $ts = "管理员审核拒绝";
+ }else{
+ $ts = "管理员审核通过";
+ }
+ $v["admin"]= "{$ts}({$v['verify_log']['admin_user']}) {$symbol} {$v['verify_log']['admin_time']}";
+ }else{
+ $v["admin"] = '--';
+ }
+
+ if(isset($v['verify_log']['verify_user'])){
+ if($v['verify_status'] == -2){
$ts = "审核拒绝";
}else{
$ts = "审核通过";
@@ -149,21 +169,21 @@ class CompanyStatementController extends ThinkController
$v["verify"] = '--';
}
- if(isset($v['verify_log']['launch_user'])){
+ if(isset($v['confirm_log']['launch_user'])){
$ts = "已发起";
- $v["launch"]= "{$ts}({$v['verify_log']['launch_user']}) {$symbol} {$v['verify_log']['launch_time']}";
+ $v["launch"]= "{$ts}({$v['confirm_log']['launch_user']}) {$symbol} {$v['confirm_log']['launch_time']}";
}else{
$v["launch"] = '--';
}
- if(isset($v['verify_log']['confirm_user'])){
+ if(isset($v['confirm_log']['confirm_user'])){
$ts = "已确认";
- $v["confirm"]= "{$ts}({$v['verify_log']['confirm_user']}) {$symbol} {$v['verify_log']['confirm_time']}";
+ $v["confirm"]= "{$ts}({$v['confirm_log']['confirm_user']}) {$symbol} {$v['confirm_log']['confirm_time']}";
}else{
$v["confirm"] = '--';
}
if(isset($v['verify_log']['pool_user'])){
- if($v['verify_status'] == -2){
+ if($v['verify_status'] == -3){
$ts = "撤销汇总";
$v["pool"]= "{$ts}({$v['verify_log']['pool_user']}){$symbol} {$v['verify_log']['pool_time']}";
}else{
@@ -190,6 +210,7 @@ class CompanyStatementController extends ThinkController
$this->assign('CompanyType',$this->CompanyType);
$this->assign('CompanyBelong',$this->CompanyBelong);
$this->assign('VerifyStatus',$this->VerifyStatus);
+ $this->assign('ConfirmStatus',$this->ConfirmStatus);
$this->display();
}
@@ -296,15 +317,40 @@ class CompanyStatementController extends ThinkController
}
}
//审批通过
+ public function adminAgree(){
+ $this->setVerifyStatus(0,1,"admin");
+ }
+ public function adminRefuse(){
+ $this->setVerifyStatus(0,-1,"admin");
+ }
public function verifyAgree(){
- $this->setVerifyStatus(0,1,"verify");
+ $this->setVerifyStatus(1,2,"verify");
}
public function verifyRefuse(){
- $this->setVerifyStatus(0,-1,"verify");
+ $this->setVerifyStatus(1,-2,"verify");
}
+
public function launch(){
- $this->setVerifyStatus(1,2,"launch");
+ if(!isset($_REQUEST['ids'])) $this->error("参数错误");
+ $ids = $_REQUEST['ids'];
+ $dbres = $this->DBModel->field("id,confirm_status,confirm_log")->where("id in ({$ids})")->select();
+ foreach($dbres as $k=>&$v){
+ if($v['confirm_status'] != 0) continue;
+ $v['confirm_log'] = json_decode($v['confirm_log'],true);
+ $v['confirm_log']['launch_user']=$this->admininfo["username"];
+ $v['confirm_log']['launch_time']=date("Y-m-d H:i:s");
+ $v['confirm_log'] = json_encode($v['confirm_log']);
+ $v['confirm_status']=1;
+ // $v['op_time'] = time();
+ $this->DBModel->save($v);
+ addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"发起确认",'url'=>U('lists')]);
+ }
+ $this->ajaxReturn(array(
+ 'status' => 1,
+ "info"=>"对外发起成功"
+ ));
}
+
protected function setVerifyStatus($old_status,$change_status,$op_pre)
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
@@ -457,7 +503,7 @@ class CompanyStatementController extends ThinkController
}
foreach ($dbres as $k=>$v) {
- if($v['verify_status'] != 3) continue;
+ if($v['verify_status'] != 2) continue;
if($v['company_belong'] == 9){
//上游
if($v['is_payment'] == 1){
@@ -516,7 +562,7 @@ class CompanyStatementController extends ThinkController
M("company_lack_statement_info","tab_")->where("id in ({$v['del_lack_ids']})")->save(["is_pool"=>1]);
}
//修改结算单规则
- $this->updatePoolVerifyStatus($v['statement_ids'],3,4,"pool",$v['statement_num']);
+ $this->updatePoolVerifyStatus($v['statement_ids'],2,3,"pool",$v['statement_num']);
}
$this->ajaxReturn(array(
'status' => 1,
@@ -843,9 +889,6 @@ class CompanyStatementController extends ThinkController
case '3':
$optist = ["viewStatement","addRemark","viewRemark","editRemark"];
break;
- case '4':
- $optist = ["viewStatement","addRemark","viewRemark","editRemark"];
- break;
default:
break;
}
@@ -871,13 +914,15 @@ class CompanyStatementController extends ThinkController
public function menuAuth()
{
$mentBtn = [
+ "adminAgree"=>"管理员审核通过",
+ "adminRefuse"=>"管理员审核拒绝",
"verifyAgree"=>"审批通过",
"verifyRefuse"=>"审核拒绝",
- "launch"=>"对外发起",
"pool"=>"发起汇总",
"updateStatement"=>"重算金额",
"export"=>"批量导出",
"updateNewStatement"=>"新增结算",
+ "launch"=>"对外发起",
];
$resarr = [];
foreach ($mentBtn as $k => $v) {
diff --git a/Application/Admin/View/CompanyStatement/lists.html b/Application/Admin/View/CompanyStatement/lists.html
index 1aaafbdae..f4972427c 100644
--- a/Application/Admin/View/CompanyStatement/lists.html
+++ b/Application/Admin/View/CompanyStatement/lists.html
@@ -146,6 +146,15 @@
+